Making WordPress.org

Changeset 13572


Ignore:
Timestamp:
04/19/2024 01:55:51 AM (10 months ago)
Author:
dd32
Message:

Support Forums: Blocks: Remove broken predef support.

This pre-def support has been broken so long that it appears no-one knew it was supposed to exist.
While predefs would be useful, this requires more work to make it work properly, so just removing it for now.

See #6608.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-blocks.php

    r13571 r13572  
    190190            ]
    191191        ) );
    192 
    193         // Add patterns.
    194         $settings['editor']['__experimentalBlockPatterns'] = WP_Block_Patterns_Registry::get_instance()->get_all_registered();
    195         $settings['editor']['__experimentalBlockPatternCategories'] = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered();
    196192
    197193        // Enable the custom paragraph that converts HTML and PHP code into a code block.
     
    417413    }
    418414
    419     /**
    420      * Register pre-defs for the forums.
    421      */
    422     public function register_predefs() {
    423         $registered = WP_Block_Patterns_Registry::get_instance()->get_all_registered();
    424         foreach ( $registered as $pattern ) {
    425             unregister_block_pattern( $pattern['name'] );
    426         }
    427 
    428         $registered = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered();
    429         foreach ( $registered as $pattern ) {
    430             unregister_block_pattern_category( $pattern['name'] );
    431         }
    432 
    433         register_block_pattern_category( 'predef', [ 'label' => 'Pre-defined Replies' ] );
    434 
    435         register_block_pattern( 'wordpress-org/no-dashboard', [
    436             'title'      => 'Cannot Access Dashboard',
    437             'categories' => [ 'predef' ],
    438             'content'    => '
    439                 <!-- wp:paragraph -->
    440                 <p>Try <a href="https://wordpress.org/support/article/faq-troubleshooting/#how-to-deactivate-all-plugins-when-not-able-to-access-the-administrative-menus">manually resetting your plugins</a> (no Dashboard access required). If that resolves the issue, reactivate each one individually until you find the cause.</p>
    441                 <!-- /wp:paragraph -->
    442 
    443                 <!-- wp:paragraph -->
    444                 <p>If that does not resolve the issue, access your server via <a href="https://wordpress.org/support/article/ftp-clients/">SFTP or FTP</a>, or a file manager in your hosting account\'s control panel, navigate to <code>/wp-content/themes/</code> and rename the directory of your currently active theme. This will force the default theme to activate and hopefully rule-out a theme-specific issue (theme functions can interfere like plugins).</p>
    445                 <!-- /wp:paragraph -->',
    446         ] );
    447 
    448         register_block_pattern( 'wordpress-org/theme-conflict', [
    449             'title'      => 'Error Related to Plugin or Theme Conflict',
    450             'categories' => [ 'predef' ],
    451             'content'    => '
    452                 <!-- wp:paragraph -->
    453                 <p>This may be a plugin or theme conflict. Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.</p>
    454                 <!-- /wp:paragraph -->
    455 
    456                 <!-- wp:paragraph -->
    457                 <p>If you can install plugins, install and activate "Health Check": <a href="https://wordpress.org/plugins/health-check/">https://wordpress.org/plugins/health-check/</a></p>
    458                 <!-- /wp:paragraph -->
    459 
    460                 <!-- wp:paragraph -->
    461                 <p>It will add some additional features under the menu item under Tools &gt; Site Health.</p>
    462                 <!-- /wp:paragraph -->
    463 
    464                 <!-- wp:paragraph -->
    465                 <p>On its troubleshooting tab, you can Enable Troubleshooting Mode. This will disable all plugins, switch to a standard WordPress theme (if available), allow you to turn your plugins on and off and switch between themes, <strong>without affecting normal visitors to your site</strong>. This allows you to test for various compatibility issues.</p>
    466                 <!-- /wp:paragraph -->
    467 
    468                 <!-- wp:paragraph -->
    469                 <p>There’s a more detailed description about how to use the Health Check plugin and its Troubleshooting Mode at <a href="https://make.wordpress.org/support/handbook/appendix/troubleshooting-using-the-health-check/">https://make.wordpress.org/support/handbook/appendix/troubleshooting-using-the-health-check/</a></p>
    470                 <!-- /wp:paragraph -->',
    471         ] );
    472 
    473         register_block_pattern( 'wordpress-org/missing-files', [
    474             'title'      => 'Error Related to Missing or Damaged Core Files',
    475             'categories' => [ 'predef' ],
    476             'content'    => '
    477                 <!-- wp:paragraph -->
    478                 <p>Try <a href="https://wordpress.org/download/">downloading WordPress</a> again, access your server via <a href="https://wordpress.org/support/article/ftp-clients/">SFTP or FTP</a>, or a file manager in your hosting account\'s control panel, and delete then replace your copies of everything <strong>except</strong> the `wp-config.php` file and the <code>/wp-content/</code> directory with fresh copies from the download. This will effectively replace all of your core files without damaging your content and settings.</p>
    479                 <!-- /wp:paragraph -->
    480 
    481                 <!-- wp:paragraph -->
    482                 <p>Some uploaders tend to be unreliable when overwriting files, so don\'t forget to delete the original files before replacing them.</p>
    483                 <!-- /wp:paragraph -->',
    484         ] );
    485 
    486         register_block_pattern( 'wordpress-org/oom', [
    487             'title'      => 'Out of Memory Errors',
    488             'categories' => [ 'predef' ],
    489             'content'    => '
    490                 <!-- wp:paragraph -->
    491                 <p>If you\'re seeing this error either suddenly (no specific task was done to cause the error) or frequently, try deactivating all plugins to rule-out a plugin-specific issue and try switching themes to rule-out a theme-specific issue.</p>
    492                 <!-- /wp:paragraph -->
    493 
    494                 <!-- wp:paragraph -->
    495                 <p>Otherwise, here are three ways to increase PHP\'s memory allocation:</p>
    496                 <!-- /wp:paragraph -->
    497 
    498                 <!-- wp:list {"ordered":true} -->
    499                 <ol><!-- wp:list-item -->
    500                 <li>If you can edit or override the system <code>php.ini</code> file, increase the memory limit. For example, <code>memory_limit = 128M</code></li>
    501                 <!-- /wp:list-item -->
    502 
    503                 <!-- wp:list-item -->
    504                 <li>If you cannot edit or override the system <code>php.ini</code> file, add <code>php_value memory_limit 128M</code> to your <code>.htaccess</code> file.</li>
    505                 <!-- /wp:list-item -->
    506 
    507                 <!-- wp:list-item -->
    508                 <li>If neither of these work, it\'s time to ask your hosting provider to temporarily increase PHP\'s memory allocation on your account.</li>
    509                 <!-- /wp:list-item --></ol>
    510                 <!-- /wp:list -->
    511 
    512                 <!-- wp:paragraph -->
    513                 <p>(in the above examples, the limit is set to 128MB)</p>
    514                 <!-- /wp:paragraph -->
    515 
    516                 <!-- wp:paragraph -->
    517                 <p><a href="https://make.wordpress.org/support/handbook/giving-good-support/pre-defined-replies/#error-500-internal-server-error"><strong>Error 500: Internal Server Error</strong></a></p>
    518                 <!-- /wp:paragraph -->
    519 
    520                 <!-- wp:paragraph -->
    521                 <p>Internal server errors (error 500) are often caused by plugin or theme function conflicts, so if you have access to your admin panel, try deactivating all plugins. If you don\'t have access to your admin panel, try <a href="https://wordpress.org/support/article/faq-troubleshooting/#how-to-deactivate-all-plugins-when-not-able-to-access-the-administrative-menus">manually resetting your plugins</a> (no Dashboard access required). If that resolves the issue, reactivate each one individually until you find the cause.</p>
    522                 <!-- /wp:paragraph -->
    523 
    524                 <!-- wp:paragraph -->
    525                 <p>If that does not resolve the issue, try switching to the default theme for your version of WordPress to rule-out a theme-specific issue. If you don\'t have access to your admin panel, access your server via <a href="https://wordpress.org/support/article/ftp-clients/">SFTP or FTP</a>, or a file manager in your hosting account\'s control panel, navigate to <code>/wp-content/themes/</code> and rename the directory of your currently active theme. This will force the default theme to activate and hopefully rule-out a theme-specific issue.</p>
    526                 <!-- /wp:paragraph -->
    527 
    528                 <!-- wp:paragraph -->
    529                 <p>If that does not resolve the issue, it\'s possible that a <code>.htaccess</code> rule could be the source of the problem. To check for this, access your server via SFTP or FTP, or a file manager in your hosting account\'s control panel, and rename the <code>.htaccess</code> file. If you can\'t find a <code>.htaccess</code> file, make sure that you have set your SFTP or FTP client to view invisible files.</p>
    530                 <!-- /wp:paragraph -->
    531 
    532                 <!-- wp:paragraph -->
    533                 <p>If you weren’t able to resolve the issue by either resetting your plugins and theme or renaming your <code>.htaccess</code> file, we may be able to help, but we\'ll need a more detailed error message. Internal server errors are usually described in more detail in the server error log. If you have access to your server error log, generate the error again, note the date and time, then immediately check your server error log for any errors that occurred during that time period. If you don’t have access to your server error log, ask your hosting provider to look for you.</p>
    534                 <!-- /wp:paragraph -->',
    535         ] );
    536     }
    537415}
Note: See TracChangeset for help on using the changeset viewer.