Support » Plugin: CSS & JavaScript Toolbox » PHP 7.2 Errors

  • We are seeing the following error_log entries using PHP 7.2. Reverting to 7.1 they go away. A Google Search on “plugins/css-javascript-toolbox/framework/events/subjects/hook.subject.php on line 81” shows a lot of others seeing the same issue.

    [09-Jul-2018 20:36:33 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/ourdomain/public_html/xyz-content/plugins/css-javascript-toolbox/framework/events/subjects/hook.subject.php on line 81

    [09-Jul-2018 20:36:33 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/ourdomain/public_html/xyz-content/plugins/css-javascript-toolbox/framework/events/subjects/hook.subject.php on line 82

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author wipeoutmedia

    (@wipeoutmedia)

    Hi there,

    Hey thanks for reporting this issue.
    You are right, there is an issue with PHP version 7.2. We will be onto this soon with an update to correct this.

    I appreciate you taking the time to let us know.

    Kind Regards,
    Damian Baker

    @wipeoutmedia Any update on the php 7.2 fix? It’s been 3 months since the last update.

    Plugin Author wipeoutmedia

    (@wipeoutmedia)

    Hi Becky,

    Thanks for checking in.
    Yes you are right, this PHP 7.2+ fix is long overdue.

    At this stage, we have all our resources tied up on a massive update for Easy Code Manager, which will have this fix, plus a truck-load of new features. Due to its responsive nature and optimised user interface, Easy Code Manager is our primary focus right now. The free version of Easy Code Manager is available right here on WordPress.org

    That said, once this development is done and released, I plan to schedule an update for CSS & JavaScript Toolbox in the near future including this fix.

    Kind Regards,
    Damian Baker

    @wipoutmedia Any update on the fix for php 7.2? It looks like the latest update did not include the fix because others have reported the same issue ( https://wordpress.org/support/topic/php-warning-177/ ).

    I was hoping I wouldn’t have to keep modifying the plugin after an update to fix this issue. Can you please provide a timeline as to when this issue might be resolved? Thanks!

    PHP7.1 is only on security updates now and the only actively developed branches are 7.2 7.3 – http://php.net/supported-versions.php
    Could we please get the fix? Even if that’s the only update coming for the next release?

    Plugin Author wipeoutmedia

    (@wipeoutmedia)

    Hello everyone,

    I am sorry for the delay in replying.
    I am very much struggling to keep the CSS & JavaScript Toolbox and Easy Code Manager projects alive to be perfectly honest. The main reason is that the user interest level for these two solutions has hit an all time low. Also, the sales from the premium editions and donations from the free editions have almost stopped completely. To be frank, it has totally dried up the coffers to continue quality development, and without funding coming in, I cannot afford to continue adding features and fixing issues.

    Unless there were:
    – some developers that could help me with the solution on a profit-share scenario
    – a much clearer marketing direction that can secure continual development
    – a promising long-term vision that is 100% compatible and complimentary with WordPress (e.g. supporting Gutenberg)
    – an exponential upsurge in user-interest
    – substantial sales and donations

    I am starting to believe these solutions have come to the end of their software life cycle.

    Kind Regards,
    Damian

    Hi Damian

    Let’s start with nnnoooooooooooooo – I don’t want to try to find any other tool. Yours works well.

    Now to the error problem here. The solution @stchris posted at https://wordpress.org/support/topic/php-warning-177/ works for me.
    It looks like PHP 7.2 now spits out an error message when trying to COUNT on NULL as per https://www.php.net/manual/en/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types
    Chris sets it to an empty array instead of NULL, so that should work without impacting anything, right?
    Or should it be array() instead of [] for older PHP compatibility? I am not that good in PHP and haven’t looked at the minimum requirements for your code.
    Please at least still push this change through as an update until you decide what to do in the future.

    Plugin Author wipeoutmedia

    (@wipeoutmedia)

    Hi Mark,

    I really appreciate your words of encouragement – especially with “nnnoooooooooooooo” 😀

    However on a serious note, I have no idea about ’empty array instead of NULL’ or ‘should it be array() instead of []’. I am a software UI designer and graphic designer – not a PHP coder. Also, I cannot afford to do more development sorry, as I pay a few hard-core third-party PHP developers for this stuff. Like I said, unless this update can be financed then I will continue to chip away at it and pay these developers to make the fixes and add the features.

    Maybe I should create a funding for features and fixes page!!!

    Regards,
    Damian Baker

    Hi Damian

    I just looked it up and the ‘[]’ syntax is supported starting in PHP 5.4 which your plugin shows as minimum requirement so it should work.
    But I can see the problem when you don’t actually program the PHP part yourself. There is no real way of knowing if that fix may break something else without going through the code and look at all the calls.

    So I took another approach and tested it on on of my my sites. It takes more code but has less consequences. You can probably run that piece of code through your programmers fairly quickly and cheaply:

    In “/css-javascript-toolbox/framework/events/subjects/hook.subject.php” lines 81-82 are now

    add_action($this->getHookName(), array(&$this, 'trigger'), 10, count($this->getDefinition('parameters')));
    add_action($this->getInstanceHookName(), array(&$this, 'trigger'), 10, count($this->getDefinition('parameters')))

    If you replace that with the following lines you should have a minimally invasive fix:

    $cntParams = is_null ( $this->getDefinition('parameters') ) ? 0 : count($this->getDefinition('parameters'));
    add_action($this->getHookName(), array(&$this, 'trigger'), 10, $cntParams);
    add_action($this->getInstanceHookName(), array(&$this, 'trigger'), 10, $cntParams);

    They should be able to confirm that this doesn’t have unintended consequences fairly quickly.

    As for the long term future – not sure about the funding for fixes unless you give up on the pro subscriptions, but funding for (extensive) new features sounds better than giving up on this software. It’s just a shame that they are now two plugins to maintain. That adds to the cost.

    The best for you and your software
    Mark

    Unrelated to the error this topic is about, I just want to say I really enjoy the plugin and rely on it tremendously. Losing this plugin’s support and bug fixes would be a huge loss to myself and according to WordPress, the 10,000+ others that are actively using the plugin.

    Please do explore how users of the plugin can continue to support its development to make it worth your time.

    Thanks for the fix @markcanada that works! @wipeoutmedia all you need to do is use the fix provided by @markcanada . Can you make sure that gets updated here?

    Plugin Author wipeoutmedia

    (@wipeoutmedia)

    Hello everyone,

    I am extremely humbled by everyone’s words of encouragement and support. I am not sure you are all aware of my position with these two plugins (CJT and ECM), but I would like to share a brief backstory.

    My background is design, graphics, marketing, pixel-perfect icons, ideas, software design, and more ideas!!! You get the picture – I am a creative. I like mentally creating solutions, but I need the experts to get it there. I do work with code (e.g. CSS, JS, PHP etc), but I am no hardcore. The PHP stuff – especially, is where I outsource to a number of developers that I call upon. So I pay the development out of my own pocket. I have basically worked for free since late 2010 in terms of the 10’s of thousands of emails, website design, managing support, doing all the graphical icons and UI designs and wireframes, brainstorming and discussing ideas with the senior developer, and the list goes on. I don’t want to bore you with that stuff, and I am sure you can understand the workload for both CSS & JavaScript Toolbox and Easy Code Manager the past decade.

    Yes, I tried to make sense of the ever-changing direction. I know I have missed the boat many times, chased some real stupid strategies – both feature strategies and marketing strategies. To be clear, the funds I have earned for both the premium versions in both projects has not even gone past the investment yet. I know – sad right!!! So these projects have been a great learning experience in project management, and I have certainly learned a lot. I have read that you may fail up to 7 times before you finally hit great success. I think I have a few more failures to go. 🙂

    Anyway, even though these projects have in a sense failed, I have really enjoyed managing it. I am immensely proud of the fact that we created two awesome and unique solutions out of thin air. I would really love to keep it going, I speak from the heart when I say this, because I do think about it often.

    I would certainly love to explore how I can resurrect these projects, if any of you guys have some ideas for me. Even ways to spread the word. An idea off the top of my head is to start up some fund-raising initiative that is crowd-funded with 100% earning from the fundraising drive going directly to development on bug fixes, PHP compatibility fixes, and even full compatibility with the new Gutenberg editor. Some of the last conversations I had with the senior developer was about having CJT and ECM code blocks output as Gutenberg blocks. I think that would be awesome and extremely useful.

    I still have the CJT and ECM projects on GitHub along with the ‘to-do’ features, tickets for bugs and issues. I just don’t have the funds to pay senior developers. That said, I do pay GitHub because I don’t want to lose those repos just in case.

    I know this is a rather long, rather sorrowful story, but it feels cathartic to get it all out their in the public domain. Especially for the supporters of all those years. I am very thankful and humbled.

    Please feel free to post and share you thoughts, ideas, anything and lets keep this discussion going. I will check back here periodically.

    Kind Regards,
    Damian Baker

    Plugin Author wipeoutmedia

    (@wipeoutmedia)

    Hi guys,

    Just a heads up.
    I have been planning to resurrect the project for both the free version of CSS & JavaScript Toolbox and the premium extensions, which I intend to call it CSS & JavaScript Toolbox ELITE. This will be a new direction for CSS & JavaScript Toolbox that will have PHP issues fixed and be fully compatible with WordPress version 5.2+ and the new Gutenberg editor. I think there is a lot of potential for CJT to work with the new editor, inject some much needed funds for the project to continue, and most importantly, make a great addition to your WordPress development toolkit.

    Kind Regards,
    Damian Baker

    • This reply was modified 8 months, 2 weeks ago by wipeoutmedia.
Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘PHP 7.2 Errors’ is closed to new replies.