[wp-hackers] Upgrading to Wordpress 3.7 is deleting a file from our plugin thus breaking a lot's of sites

Otto otto at ottodestruct.com
Sun Oct 27 19:11:32 UTC 2013


You can avoid that entirely just by naming the for-pay plugin
something different and giving it a different Plugin URI. Tack on a
"premium" to the end or something.

Or, better yet, make the for-pay version simply use the free version
and add on the features and such. This is probably the best long-term
strategy. The free plugin can have do_action() and apply_filter()
calls in appropriate places, and the paid version can then be a
separate plugin which uses those hooks to expand and extend the free
code.

-Otto


On Sun, Oct 27, 2013 at 12:42 PM, Nicola Peluchetti
<nicola.peluchetti at gmail.com> wrote:
> Yes it's insane throwing an exception (and not catching it) but we all
> dealt with legacy code. We are rewriting/re-architecturing the pugin right
> now. Looking at some sites i've also finally found where the issue was:
> Wordpress 3.7 Broke our code which we used to prevent updating to
> wordpress.org version.
> So the user of our standard version where prompted to download the version
> on wordpress.org which has a totally different way of serving resources. No
> update of files in wp-content was triggered and for this reason the file
> were not there.
>
> Thanks for the help and the advice.
>
> * *
> *Nicola Peluchetti - Senior PHP Developer @ Timely**
> *
> Twitter: @nik_peluchetti <https://twitter.com/#!/nik_peluchetti>
> Facebook: nicola.peluchetti <https://www.facebook.com/nicola.peluchetti>
> Stackoverflow: Stackoverflow<http://stackoverflow.com/users/397861/nicola-peluchetti>
> Mobile: +39 339 7507235
>
>
> On Sat, Oct 26, 2013 at 5:59 PM, Andrew Nacin <wp at andrewnacin.com> wrote:
>
>> An exception over a missing CSS file? Really? That also means you are
>> running unnecessary systems calls on every page, slowing down sites for no
>> good reason. Rather than wasting effort and CPU cycles on a global
>> exception handler, consider removing this.
>>
>> WordPress doesn't touch wp-content during an update unless it is to copy
>> over a new default theme, so I don't really know what's going on here. I
>> can pretty safely say this is not WordPress core.
>>
>> If you want to understand, start by responding to John. "Potential cause:
>> People running a plugin which forces plugin uninstall routines to run when
>> plugins are disabled? It would help hugely if you can get a list of active
>> plugins on affected sites from users who are experiencing the problem."
>>
>> Nacin
>>
>>
>> On Sat, Oct 26, 2013 at 11:33 AM, Nicola Peluchetti <
>> nicola.peluchetti at gmail.com> wrote:
>>
>> > The fact is that only the event.min.js file seems to be deleted. Not the
>> > whole folder. I released 1.10.4 to address this, basically i fall back to
>> > loading the file from our original folder if the file is missing from
>> > wp-content. Still would like to understand why this is happening.
>> > Version 2.0 will have a global exception/error handler to avoid bringing
>> > down websites and wasting my weekends fixing things :D
>> >
>> > * *
>> > *Nicola Peluchetti - Senior PHP Developer @ Timely**
>> > *
>> > Twitter: @nik_peluchetti <https://twitter.com/#!/nik_peluchetti>
>> > Facebook: nicola.peluchetti <https://www.facebook.com/nicola.peluchetti>
>> > Stackoverflow: Stackoverflow<
>> > http://stackoverflow.com/users/397861/nicola-peluchetti>
>> > Mobile: +39 339 7507235
>> >
>> >
>> > On Sat, Oct 26, 2013 at 5:08 PM, John Blackbourn
>> > <johnbillion+wp at gmail.com>wrote:
>> >
>> > > This plugin's `uninstall.php` file deletes the
>> > WP_CONTENT_DIR/themes-ai1ec
>> > > directory when called. It sounds like this plugin's uninstall.php file
>> is
>> > > being called during the upgrade.
>> > >
>> > > Potential cause: People running a plugin which forces plugin uninstall
>> > > routines to run when plugins are disabled?
>> > >
>> > > @Nicola: It would help hugely if you can get a list of active plugins
>> on
>> > > affected sites from users who are experiencing the problem.
>> > >
>> > >
>> > > On 26 October 2013 15:29, Nicola Peluchetti <
>> nicola.peluchetti at gmail.com
>> > > >wrote:
>> > >
>> > > > Hi,
>> > > >
>> > > > sure that's horrible, we will fix that, but the real problem is that
>> > the
>> > > > file is deleted. If we catch the exception still the js is not loaded
>> > and
>> > > > the file was there before the upgrade.
>> > > > During the upgrade process, is any plugin code executed?We already
>> have
>> > > 25
>> > > > people reporting our plugin as not compatible with 3.7 for this and i
>> > > > imagine people affected are many more. I can't replicate this
>> locally,
>> > i
>> > > > will add a check to load that file from our plugin dir and not
>> > > wp-content i
>> > > > can't think of any other way to handle this.
>> > > >
>> > > > * *
>> > > > *Nicola Peluchetti - Senior PHP Developer @ Timely**
>> > > > *
>> > > > Twitter: @nik_peluchetti <https://twitter.com/#!/nik_peluchetti>
>> > > > Facebook: nicola.peluchetti <
>> > https://www.facebook.com/nicola.peluchetti>
>> > > > Stackoverflow: Stackoverflow<
>> > > > http://stackoverflow.com/users/397861/nicola-peluchetti>
>> > > > Mobile: +39 339 7507235
>> > > >
>> > > >
>> > > > On Fri, Oct 25, 2013 at 8:41 PM, Otto <otto at ottodestruct.com> wrote:
>> > > >
>> > > > > On Fri, Oct 25, 2013 at 12:18 PM, Nicola Peluchetti
>> > > > > <nicola.peluchetti at gmail.com> wrote:
>> > > > > > Hi,
>> > > > > >
>> > > > > > we received lot's of reports that our plugin is not compatible
>> with
>> > > 3.7
>> > > > > and
>> > > > > > many site where brought down. The problem seems to be that
>> > wordpress
>> > > > 3.7
>> > > > > > upgrade deletes ( in some occasions ) a file in a folder we
>> create
>> > in
>> > > > > > wp-content.
>> > > > > >
>> > > http://wordpress.org/support/topic/not-compatible-with-wp-37?replies=8
>> > > > > >
>> > > > > > The file name is event.min.js and we create the folder
>> themes-ai1ec
>> > > > under
>> > > > > > wp-content. Any idea why this might be happening?This doesn't
>> seem
>> > to
>> > > > be
>> > > > > > under our control but user are blaming us. If we need to change
>> > > > something
>> > > > > > to be compatible, we will, but i have no guess now on what to do.
>> > > > >
>> > > > > While I can't see any particular reason for a file like that to be
>> > > > > deleted on an update, this error is coming entirely from your
>> plugin.
>> > > > >
>> > > > > Examine the error message posted in this thread:
>> > > > >
>> > http://wordpress.org/support/topic/not-compatible-with-wp-37?replies=8
>> > > > >
>> > > > > If you examine that code, you have this:
>> > > > >
>> > > > > if( $file_found === false ) {
>> > > > > throw new Ai1ec_File_Not_Found( "The specified file '" . $file . "'
>> > > > > doesn't exist." );
>> > > > > }
>> > > > >
>> > > > > That is a pretty horrible thing to do on a production site *if*
>> > you're
>> > > > > not catching the exception higher up and handling it gracefully. An
>> > > > > uncaught exception is a fatal error = Instantly broken site.
>> > > > >
>> > > > > I would look at all the places you're calling functions that can
>> > throw
>> > > > > Ai1ec_File_Not_Found and putting catches around them, to handle the
>> > > > > situation better.
>> > > > >
>> > > > > -Otto
>> > > > > _______________________________________________
>> > > > > wp-hackers mailing list
>> > > > > wp-hackers at lists.automattic.com
>> > > > > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> > > > >
>> > > > _______________________________________________
>> > > > wp-hackers mailing list
>> > > > wp-hackers at lists.automattic.com
>> > > > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> > > >
>> > > _______________________________________________
>> > > wp-hackers mailing list
>> > > wp-hackers at lists.automattic.com
>> > > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> > >
>> > _______________________________________________
>> > wp-hackers mailing list
>> > wp-hackers at lists.automattic.com
>> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> >
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list