• Restrict content caused a fatal error on this site. The host support found this error message below. The site is using PHP 7.4, plugin version 3.1.9. Current status is that the plugin is deactivated and the content unprotected. We need a fix.

    “NOTICE: PHP message: PHP Fatal error: Uncaught Error: Class ‘RCP_Telemetry’ not found in /www/wp-content/plugins/restrict-content/restrictcontent.php:130”

    The page I need help with: [log in to see the link]

Viewing 15 replies - 16 through 30 (of 37 total)
  • Same here. Completely breaks site.

    Plugin Contributor Israel Barragan

    (@reedyseth)

    Guys, I’ve been trying to replicate the issue without any success. I tried in a fresh install and found no error. Also I tried updating version 3.1.8 to 3.1.9 in the plugins dashboard and also no error. Tried with PHP version 7.4 and also 8.0, no error.

    If you are able to provide the step each of you took I might look into it.

    My last suggestion is that you might have file caching issues. So please clean your cache if you are using a caching plugin or in. your hosting. If any of you that reported the issue has a caching plugin please list it.

    Please share any log, screenshot or screencast that you might have.

    We are using WP Rocket on 1and1 and the bug happened after an automatic plugin update.
    PHP 7.4.33

    lo mismo yo uso LiteSpeed Cache borre cache y aun sigue el error y si tenia la actualización automática activada, en mi caso no me funcionaba instalar una antigua version o borrarla seguia el error pero lo solucione copiando la carpeta desde cpanel, ya que tenia una pagina donde no se actualizo, ojala le sirva a alguien, saludos

    Hi,

    i have the same problem and i fix this temporely with uncomment this lines in this file

    \wp-content\plugins\restrict-content\restrictcontent.php

    After this action the site is at least further accessible. Please note that all hidden elements are then visible!!!

    /*
    // Load Strauss autoload.
    require_once plugin_dir_path( __FILE__ ) . 'vendor/strauss/autoload.php';
    */
    
    
    
    /*
    use RCP\StellarWP\Telemetry\Config;
    use RCP\StellarWP\Telemetry\Core as Telemetry;
    use RCP\Container;
    */
    
    /*
    add_action('plugins_loaded', array( $this, 'plugins_loaded' ));
    */
    
    
    /*
        public function plugins_loaded() {
            // Initialize Telemetry.
            $container = new Container();
            Config::set_hook_prefix( 'rcp' );
            Config::set_stellar_slug( 'restrict-content' );
            if ( defined('TELEMETRY_SERVER') ) {
                Config::set_server_url( TELEMETRY_SERVER );
            }
            else {
                Config::set_server_url( 'https://telemetry.stellarwp.com/api/v1' );
            }
            Config::set_container( $container );
            Telemetry::instance()->init( __FILE__ );
    
            $rcp_telemetry = new RCP_Telemetry();
            $rcp_telemetry->init();
        }
    
    */

    best regards
    Joachim

    • This reply was modified 1 year, 8 months ago by ripixxx.
    • This reply was modified 1 year, 8 months ago by ripixxx.

    I have a fatal error this morning too:

    WordPress 6.1.1
    PHP 8.1
    Nginx

    I have reverted back to 3.1.8 and fine again now.

    Error Details
    
    =============
    
    An error of type E_ERROR was caused in line 130 of the file /home/user-MYWEBSITE/webapps/MYWEBSITE/wp-content/plugins/restrict-content/restrictcontent.php. Error message: Uncaught Error: Class "RCP_Telemetry" not found in /home/user-MYWEBSITE/webapps/MYWEBSITE/wp-content/plugins/restrict-content/restrictcontent.php:130
    
    
    • This reply was modified 1 year, 8 months ago by mactedder.
    • This reply was modified 1 year, 8 months ago by mactedder.
    • This reply was modified 1 year, 8 months ago by mactedder.

    @reedyseth

    I have no Plugins install for Caching in WordPress

    Plugin is running under

    • WordPress 6.1.1
    • Debian Linux 10
    • Apache 2.4.38 / PHP 7.4.33

    I have this Apache direktiven activ

    EXPIRES CACHING
    
    
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days" Website ExpiresByType text/html "access plus 600 seconds"
    ExpiresByType text/htm "access plus 600 seconds"
    ExpiresByType text/javascript "access plus 2 days"
    ExpiresByType text/css "access plus 2 days"
    ExpiresByType text/xml "access plus 2 days"
    ExpiresByType application/xml "access plus 0 seconds"
    ExpiresByType application/json "access plus 0 seconds"
    ExpiresByType text/cache-manifest "access plus 0 seconds"
    EXPIRES CACHING
    Plugin Contributor Israel Barragan

    (@reedyseth)

    Guys, please include in your report the following:

    • WordPress version.
    • PHP Version.
    • Server type and version(Apache/Nginx).
    Plugin Contributor Israel Barragan

    (@reedyseth)

    Please replace the file restrict-content/restrictcontent.php with the content of this:

    https://gist.github.com/Reedyseth/93b09bff92108d73f6797a057f9e8218

    and please share if this fixed your issue.

    @reedyseth

    perfect. works for me. thank you very much.. ??

    I just tried updating the plugin and the site crashed... am seeing this in the log:
    
    [25-Mar-2023 20:41:38 UTC] PHP Fatal error: Uncaught Error: Class 'RCP_Telemetry' not found in /home/[sitename]/public_html/wp-content/plugins/restrict-content/restrictcontent.php:130
    Stack trace:
    
    0 /home/[sitename]/public_html/wp-includes/class-wp-hook.php(308): RC_Requirements_Check->plugins_loaded('')
    
    1 /home/[sitename]/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
    
    2 /home/[sitename]/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    
    3 /home/[sitename]/public_html/wp-settings.php(480): do_action('plugins_loaded')
    
    4 /home/[sitename]/public_html/wp-config.php(100): require_once('/home/[sitename]/…')
    
    5 /home/[sitename]/public_html/wp-load.php(50): require_once('/home/[sitename]/…')
    
    6 /home/[sitename]/public_html/wp-blog-header.php(13): require_once('/home/loadmast/…')
    
    7 /home/[sitename]/public_html/index.php(17): require('/home/[sitename]/…')
    
    8 {main}
    
    thrown in /home/[sitename]/public_html/wp-content/plugins/restrict-content/restrictcontent.php on line 130
    • This reply was modified 1 year, 8 months ago by mywebmaestro.

    Israel Barragan?thank you, it works !!!

    “Please replace the file?restrict-content/restrictcontent.php?with the content of this:?

    https://gist.github.com/Reedyseth/93b09bff92108d73f6797a057f9e8218

    and please share if this fixed your issue.”

    I had same problem…update to version 3.1.9 of Restrict Content crashed my site. Thanks to asaynisch for suggesting commenting-out lines 130-131 of restrictcontent.php. This solved the problem immediately and the plugin is now operating normally.

    Replacing the file?restrict-content/restrictcontent.php?with the content of this one:

    https://gist.github.com/Reedyseth/93b09bff92108d73f6797a057f9e8218
    fixed de problem. Thanks!

    Plugin Contributor Israel Barragan

    (@reedyseth)

    I just released the hotfix, version 3.1.9.1. Could you all confirm that this resolves the issue?

Viewing 15 replies - 16 through 30 (of 37 total)
  • The topic ‘Fatal error from Restrict Content plugin’ is closed to new replies.