WordPress.org

Support

Support » Plugins and Hacks » Jetpack Lite » [Resolved] new update crashed my site!!

[Resolved] new update crashed my site!!

  • Just updated the plugin and crashed my whole site

    Fatal error: Call to undefined function is_plugin_active() in /home/content/26/11868026/html/wp-content/plugins/jetpack-lite/jetpack-lite.php on line 12

    had to go in to my hosting provider account and delete the plugin root folder to gain access back to my site!

    others be careful before updating, what may happens to your site will scare a novice webmaster.

    hopefully a fix will come soon so I can re-install this plugin

    http://wordpress.org/plugins/jetpack-lite/

Viewing 15 replies - 16 through 30 (of 44 total)
  • Plugin Author Samuel Aguilera

    @samuelaguilera

    @tschaplin The fact is that I have it running without problem in dozen sites… So I cant reproduce the problem here.

    And it’s weird because is_active_plugin() is a WordPress core function, not mine, and is present since WordPress 2.5…

    So I think that there’s something at your installations that is causing for some reason the problem with the use of that function.

    Did you make any change to WordPress defaults? maybe changed wp-content path or anything?

    PS. Anyway, I’m uploading an update for respectful and helpful people like you, disabling the use of that function to avoid more problems while tracking the issue.

    @samuel Thanks for your reply. At the moment I am not aware of having made any sensitive changes in my WP defaults, but I will check it.
    In my experience these error messages rarely are pointing to the real culprit – so some hardcore debugging will be necessary – I will try to do it later this afternoon.

    Anyway, thanks for your work, I really appreciate it.

    tschaplin

    Plugin Author Samuel Aguilera

    @samuelaguilera

    Thank your for your kind words @tschaplin I appreciate it very much. If you gather any other info that I can use to debug it please let me know.

    In the other hand 3.0.1 is available and will solve the issue for those that have it.

    Yep, 3.0.1 brings the fix – thx. But anyway I will try to find out what was the reason with the 3.0 issue.

    I updated to version 3.0 directly from within my WP admin page (where it says “update now”), never having had any problems with updating other plugins.

    After restoring functionality to my blog by simply deleting the Jetpack Lite plugin folder on cPanel, I came here and read, “IMPORTANT: Starting from version 3.0 this plugin becomes a Jetpack addon and not a standalone plugin as in previous versions. Now you need to install Jetpack too.”

    I did not have Jetpack installed (didn’t know I needed it). Could this have been the cause of the problem?

    I have a few plugins that depend on other plugins, but I am not using the is_active_plugin() function, instead I am using a function adapted from a post on wpengineer. Not only does that actually work instead of shutting down entire sites, it also “dies” in a nice way with a customizable error message.

    If you’re interested, you can have a look at my SO Related Posts plugin I released the other day, which uses it.

    In my opinion it is wrong when Jetpack is not active to disable an entire site. It’s just ridiculous that both frontend and backend fall apart after upgrading your plugin. I am very sorry to say, but that is your responsibility, not mine. Especially since you don’t have bothered to add an upgrade notice to your readme.txt! You only added it to the changelog, but such an important change should be added to the Upgrade Notice as well, same as you have done for 2.3.4 and 2.3.4.1.

    The sites I updated Jetpack Lite on are all running either WP 3.8 or WP 3.9-alpha nightly build versions, so nice try, but that certainly is not the problem.

    Also when an error log says that the fatal error has been detected on line 12 of jetpack-lite.php, then why would you blame the user for having it wrong? That’s just weird, dude!

    I can imagine you’re frustrated with an obvious too early release of your plugin update, but blaming the users that report this issue is just not going to score you any goodwill here.

    and min WP version requirement for the plugin is set to WP 3.1

    Actually it is 3.5 as line 17 of your plugin clearly says: define( 'JETPACK__MINIMUM_WP_VERSION', '3.5' );

    I had a quick look at 3.0.1, but that just doesn’t make any sense, so for now I have followed @morphman‘s suggestion for the sites that fell apart and for the sites that I could save in time for now I am using an adapted version of 2.3.4.1, the latest working version of your plugin.

    I’m running the most recent version of WordPress, 3.8, and got the error.

    @gaplauche try updating to 3.0.1 – and don’t forget to have installed jetpack too. That should work now.

    @tschaplin I just tried Jetpack Lite 3.0.1 and it’s working fine. 3.0 did give me the OP’s error, however, even with Jetpack installed first on WordPress 3.8.

    My WordPress installation is a one-click install on DreamHost, unmodified by me, running the Thesis 2.1 theme.

    @gaplauche seems that we have the same combination. Strangely the WP 3.8/ jetpack-lite 3.0 didn’t work in none of my installations. I am still trying to track down the reason, but couldn’t find any clue till now.

    Though I preferred the standalone concept of jetpack-lite, it even makes sense now combined with jetpack. Several quick scans with the P3 plugin performance profiler showed the load is cut by more than 50 percent with jetpack-lite in comparison with jetpack alone. The only disadvantage now is having lying about lots of useless data of the several MB heavy jetpack installation.

    @tschaplin @gaplauche I think the problem simply sits in the code: the 3.0 version of the plugins is these lines:

    if ( is_plugin_active( 'jetpack/jetpack.php' ) ) {
    
    		function Leave_only_JetpackLite_modules ( $modules ) {
    		    $return = array();
    		    $return['stats'] = $modules['stats'];
    		    $return['shortlinks'] = $modules['shortlinks'];
    		    return $return;
    		}
    
    		add_filter( 'jetpack_get_available_modules', 'Leave_only_JetpackLite_modules' );
    
    		function Activate_only_JetpackLite_modules() {
    		    return array( 'stats', 'shortlinks' );
    		}
    
    		add_filter( 'jetpack_get_default_modules', 'Activate_only_JetpackLite_modules' );
    
    }

    So what happens if ( ! is_plugin_active( 'jetpack/jetpack.php' ) ) ?

    Everything falls apart, that’s what happens.

    As mentioned before, requiring a plugin can be done entirely different:

    $plugins = get_option( 'active_plugins' );
    
    $required_plugin = 'jetpack/jetpack.php';
    
    // multisite throws the error message by default, because the plugin is installed on the network site, therefore check for multisite
    if ( ! in_array( $required_plugin , $plugins ) && ! is_multisite() ) {
    
    	add_action( 'admin_notices', 'so_no_jetpack_warning' );
    
    }
    
    function so_no_jetpack_warning() {
    
        // display the warning message
        echo '<div class="message error"><p>';
    
        printf( __( 'The <strong>Jetpack Lite Addon</strong> only works if you have the <a href="%s">Jetpack</a> plugin installed.', 'jetpack-lite' ),
            'http://wordpress.org/plugins/jetpack/' );
    
        echo '</p></div>';
    
        // and deactivate the plugin
        deactivate_plugins( plugin_basename( __FILE__ ) );
    }

    Another option would be to include the TGM Plugin Activation Class, which enables the user who is unaware the plugin has been changed into an Addon and is now dependant on Jetpack to function, to install Jetpack straight from the Dashboard. I have not worked with that class myself yet, but it has been recommended to me by another developer.

    In addition to what I mentioned above, I think that on a squeaky clean brand new WP install the 3.0 version could actually work.

    But updating from 2.3.4.1 to 3.0 will fail miserably, because none of the old settings are removed from the user’s options, the plugin goes from 20 something files to 1 file and all the rest is simply not there anymore.

    In my opinion that is recipe for disaster…

    In 3.0.1 the author has removed the if statement, so I expect that Jetpack Lite simply does not function anymore without Jetpack installed, but many users will only discover that next week or even further down the line, because not everyone watches their stats with the same frequency.

    Therefore 3.0.1 is hardly a solution, but merely postponing a shitstorm.

    Again, I want to emphasise that this is just my opinion.

    @piet, thanks – the code proposed by you is working – chapeau. However 3.0.1 is working too. So the question remains, why 3.0 didn’t work? You may be right, that old scrap might prevent it from working. (I will spend some further time to investigate this).

    It’s true, as a mere addon jetpack-lite now needs jetpack to be installed (and users accustomed to read the release notes carefully – other than me – lol). Nevertheless with 3.0.1 working jetpack-lite brings considerable benefits in speed and system load compared with the full jetpack package standalone. So in my opinion it is a solution as for preventing any unnecessary overloads.

    So a solution would be to uninstall Jetpack Lite, then use a plugin like Clean Options to clear out the old Jetpack Lite settings before installing it?

    Plugin Author Samuel Aguilera

    @samuelaguilera

    @gaplauche you dont need to clear anything. the upgrade doesnt remove anything. the things @piet is saying about this is not true. And anyway, this is not the topic of this thread.

    If you feel you have another problem, please open another thread with the proper information.

Viewing 15 replies - 16 through 30 (of 44 total)
  • The topic ‘[Resolved] new update crashed my site!!’ is closed to new replies.
Skip to toolbar