[Simple Ads] PHP Notice: Trying to get property 'id' of non-object in simple-ads.php on

Hi there.

Running a wp-content/debug.log it displays this error:
PHP Notice: Trying to get property 'id' of non-object in /xxxxx/xxxxx/xxxxxx/wp-content/plugins/simple-ads/simple-ads.php on line 130

Can this be corrected in next update, thanks?

  • Adam Czajczyk
    • Support Gorilla

    Hi Ian

    I hope you're well today and thank you for your question!

    That's related to the multisite "main blog" detection which on single site installs is irrelevant (as there's no "main blog"). It's a notice only and it actually won't even show up on many setups as it depends on the PHP error reporting settings and its function is pretty much informational only.

    However, I agree that should be taken care off on the code level so thanks for reporting it! I've already submitted the case to our developers, marking it as a bug.

    Best regards,
    Adam

  • Adam Czajczyk
    • Support Gorilla

    Hello Ian

    I've attached a .zip file to this post. The file contains patched .php file for the plugin so would you please give it a try?

    To do so:
    - download the .zip file
    - make a backup copy of a "simple-ads.php" file from the "/wp-content/plugins/simple-ads/" folder on the server
    - upload "simple-ads.php" file from inside downloaded zip file to the "/wp-content/plugins/simple-ads/" folder on the server, overwriting existing one

    Once that's done, clear all caches on the site and sever (if there are any) and check please if you're still getting the notice or not and if the plugin is still working the same.

    Let me know please if this patch solves the issue for you. In case it didn't, please restore the original file on the server and let me know here as well.

    Best regards,
    Adam

  • Ian
    • The Incredible Code Injector

    Hi Adam,

    Sorry for slow response. I have tested it and it worked. I no longer see that error in the debug.log

    Can you roll out this update to the plugin, so I can update it from control panel on my other sites?

    Thanks, Ian

  • Adam Czajczyk
    • Support Gorilla

    Hello Ian

    Thank you for confirmation that it works.

    I'm afraid though that it's not possible anymore to update the plugin via the "control panel" (may it be The Hub or directly WPMU DEV Dashboard on the site) as the plugin has been retired (along with many other) already and is no longer available from us.

    https://premium.wpmudev.org/blog/wpmu-dev-legacy-plugins/

    It's been "set free" and uploaded to our GitHub account here:

    https://github.com/wpmudev/simple-ads

    However, I'll do my best to push that change to the GitHub repository as soon as possible so an updated version of the plugin would be available there.

    Best regards,
    Adam

  • Ian
    • The Incredible Code Injector

    Okay, thanks.

    I am new to github and not sure how it works, looks confusing with all those files.

    So guessing, to get the zip file to install into Wordpress, I click on "clone or download" button and click the download zip.

    And then log into wordpress plugin area and upload it there, and it will automatically overwrite the existing older version?

    I understand the updated one isn't on github yet, but get figuring out how to use, so when it does get pushed there, I will know what to do.

  • Adam Czajczyk
    • Support Gorilla

    Hello Ian

    So guessing, to get the zip file to install into Wordpress, I click on "clone or download" button and click the download zip.

    And then log into wordpress plugin area and upload it there, and it will automatically overwrite the existing older version?

    Yes, that would be the easiest way:
    - click on "Clone or download"
    - select downlad zip
    - extract downloaded zip file to your local drive and then upload the plugin folder from inside the downloaded zip file to the site's /wp-content/plugins folder using FTP, overwriting existing one.

    But please note that at this moment, it'd be better to actually use the patch that I provided you with. As I said, I'll do my best to push that patch to GitHub as soon as possible but personally I do not have access and any permissions to control what's on our company GitHub account so I passed that over to our developers asking them to take care of that. Since they are working on a lot of complex issues on daily basis, I'm not really able to give you any ETA on when they'll be able to do this.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.