Home › Forums › UM Switcher › Cron Job Error
Tagged: Cron Job
- This topic has 48 replies, 4 voices, and was last updated 7 years, 5 months ago by lazormish.
-
AuthorPosts
-
-
at #81743osuthernsMember
I am trying to get the Cron Job to work on UM Switcher. I am stuck on the following error:
PHP Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/alecccwh/public_html/cron.php on line 16
PHP Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/alecccwh/public_html/cron.php on line 22
Content-type: text/html; charset=UTF-8Please advise as to what I should do.
-
at #81746adminKeymaster
Hi there,
1 – check if you have used the correct login details and added all required fields.
2 – check with your hosting if a cronjob is included. -
at #81747osuthernsMember
Thanks Mike.
1. The login credentials are correct. The host has confirmed this. They have also run the Cron Job manually with no apparent errors. The only field not included is $base_prefix=”; because it is not a multisite installation.
2. Cronjob is included and running (scheduled every hour).
3. I have ONE test subscription only for now… that had a duration of one hour, which has long since passed (yesterday).
4. Every hour I receive the same email sent to my specified Cron Job email address:
PHP Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/alecccwh/public_html/cron.php on line 16
PHP Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/alecccwh/public_html/cron.php on line 22
Content-type: text/html; charset=UTF-8Host says it is a scripting problem and provided the following information about versions that are running:
================
The server is running with Mysql 5.6.35 server.
—
[root@cwh26 ~]# mysql -V
mysql Ver 14.14 Distrib 5.6.35, for Linux (x86_64) using EditLine wrapper
[root@cwh26 ~]# hostname
cwh26.canadianwebhosting.com
—
And all our shared servers are installed with CloudLinux. So you can choose the PHP versions according to your requirement using the PHP selector on your cPanel (Software/Services >> Select PHP Version >> Select PHP version you want from the drop down box and click on “Set as current”.) The following PHP versions are available 4.4 5.1 5.2 5.3 5.4 5.5 5.6 7.0 7.1 -
at #81748adminKeymaster
Okay that’s looks fine.
How is your time zone set? UTC or a city? -
at #81749osuthernsMember
WP settings have the time zone set as a city – Toronto.
-
at #81750adminKeymaster
That’s also fine.
Well I;m running out of ideas here, I know um-switcher works so it must be something your installation or hosting.I assume you have the latest version woocommerce installed.
Try to deactivate all other plugins besides: woocommerce, ultimate member and um-swutcher. -
at #81751osuthernsMember
OK. I will do as suggested and get back to you as soon as I can.
-
at #81752osuthernsMember
I confirmed we are running the latest version of WooCommerce.
I deactivated all plugins except WooCommerce, Ultimate Member, UM-Switcher.
I continue to get the same emailed error message.
-
at #81755osuthernsMember
Hi Mike.
Response from my host below:
========
Regarding the PHP warning about mysqli, it appears the SQL query has an error in it and hence the warning. Please refer following threads about the same issue :
http://stackoverflow.com/questions/2546314/php-mysql-mysqli-num-rows-expects-parameter-1-to-be-mysqli-result-boolean
http://stackoverflow.com/questions/16756596/warning-mysqli-num-rows-expects-parameter-1-to-be-mysqli-result-boolean-giveIt should be corrected by the developer of the plugin.
-
at #81770adminKeymaster
Hi osutherns,
I will pass this one to our team, because this guy has no idea 🙂 I know that were running PHP 7 and maybe that’s way we don’t get such a error notice but like I said: Mikey has no idea. -
at #81775osuthernsMember
OK. Thanks.
We really need to get this working asap. My host has confirmed that the Cron Logs are showing that the job is running on schedule, but the emails are not being sent as they should.
Oliver
-
at #81779osuthernsMember
quick question.
what’s the easiest way to export my subscribers to an excel or csv file?
Oliver
-
at #81780adminKeymaster
Olivier,
Try the wp repo there Will be free plug-ins you can use. Paid plug-ins look at woocommerce. -
at #81782adminKeymaster
Hi Olivier,
We just run a test here and I get the reminders with no problem. But I think and hope that the issue is your PHP version. We run the latest version PHP 7, can you set your server to PHP7 and see again.
You will love PHP7 as it’s much faster, the backend for example is much faster.
Mike
-
at #81783osuthernsMember
Would making the switch to 7 impact on other elements of the site in a negative way?
-
at #81784adminKeymaster
Normally not but to be sure look at your theme and other plugins if they can run on PHP7.
-
at #81785osuthernsMember
I’ve swithced to PHP 7.
There was one error message about mySQL which appears to have been resolved by selecting mysqli option in the PHP Options panel.
There is an email reminder scheduled to go out in about 45 minutes… fingers crossed.O.
-
at #81786osuthernsMember
No luck.
We are now running PHP7 and host has confirmed that Cron Job is running as scheduled, but it is still generating errors when they try to run it manually and the reminder email that I was expecting to see at 7:38 did not arrive. See message below from host (two messages combined for convenience here: (Also I have attached the cron.php file that I am using – provided by you folks and modified for my site):
========
The Cron job is being executed at the server end.We are pasting the log details for your verification.
—
May 9 00:00:01 cwh26 CROND[289451]: (alecccwh) CMD (/usr/local/bin/php -q /home/alecccwh/public_html/cron.php)
May 9 01:00:01 cwh26 CROND[304924]: (alecccwh) CMD (/usr/local/bin/php -q /home/alecccwh/public_html/cron.php)
May 9 02:00:01 cwh26 CROND[322152]: (alecccwh) CMD (/usr/local/bin/php -q /home/alecccwh/public_html/cron.php)
May 9 03:00:01 cwh26 CROND[335933]: (alecccwh) CMD (/usr/local/bin/php -q /home/alecccwh/public_html/cron.php)
May 9 04:00:01 cwh26 CROND[352017]: (alecccwh) CMD (/usr/local/bin/php -q /home/alecccwh/public_html/cron.php)
—We are still getting error message when we manually run the cron job.Please check the script at your end as mentioned earlier.
—
[root@cwh26 ~]# php -d display_errors /home/alecccwh/public_html/cron.phpWarning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/alecccwh/public_html/cron.php on line 16
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/alecccwh/public_html/cron.php on line 22
[root@cwh26 ~]#
—From mail logs, I can see one reminder mail sent today at 13:59 (PST), but cron job wasn’t scheduled and run at that time. So it is clear that the mails are not getting send from the cron script and it seems to be triggered from somewhere else (may be when logging into WP admin area as you suspect).
====
2017-05-08 13:59:49 1d7pkz-000WY4-4T info R=virtual_user T=dovecot_virtual_delivery_no_batch C=”250 2.0.0 MWFnEUXcEFnS6AEAZFOV6g Saved”
2017-05-08 13:59:49 1d7pkz-000WY4-4T => jennykerber1@gmail.com (info@alecc.ca) R=barracuda_route T=dkim_remote_smtp H=barmail1.idig.net [64.34.111.254] X=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256 CV=yes C=”250 Ok: queued as 9883C2E06C”
2017-05-08 13:59:49 1d7pkz-000WY4-4T -> suthernsjacob@gmail.com R=barracuda_route T=dkim_remote_smtp H=barmail1.idig.net [64.34.111.254] X=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256 CV=yes C=”250 Ok: queued as 9883C2E06C”
2017-05-08 13:59:49 1d7pkz-000WY4-4T Completed
====PHP log_errors options is already enabled, but no errors are getting logged in error_log file. The script contains queries to MySQL database (alecccwh_wp) and many “if” conditions. DB credentials in the script are correct and hence the script should be able to access MySQL database. It is possible that one or more “if” conditions are not working or there is a misconfiguration in conditions resulting in failure to send reminder mails. Please ask the plugin vendor to test the cron script and check for issues with conditions.
Please ask the developer/plugin vendor about the requirements of the plugins (like PHP version, MySQL version, PHP modules/values/settings etc.) and check if it is possible to enable debugging for the cron script.
-
at #81789osuthernsMember
Hi Mike.
Some more info that may help in your resolution of my challenges…
I started four 2-hour subscriptions today, all started between 8:20 and 8:35pm, set up with two reminder emails… #1 – one hour before expiration and #2 – 30 minutes before expiration.
At 10:15 I had not received any reminder emails. I logged into the wp-admin side of the site.
At 10:16 I received email Reminder #2 – wrong one and late (which was set to trigger 30 minutes before expiration).
At 10:40, once all should have expired I logged in once again.
At 10:41 I received email Reminder #1 – wrong one and late (which was set to trigger one hour before expiration).
I hope this helps in the investigation.
Cheers,
Oliver
-
at #81791adminKeymaster
Hi Oliver
Well that’s great to hear as it means that cron.php is executed, because when you login it will run the script and you get the reminders in your email box as you noticed.When I look at the schedule I see that the cron is set on your server but at an interval of 1 hour.
May 9 00:00:01
May 9 01:00:01
May 9 02:00:01
May 9 03:00:01adjust the cron to for example to 1 minute interval.
-
at #81792osuthernsMember
Thanks Mike.
I have tried this with the Cron Job scheduled every minute, every 5 minutes, daily, etc. Lots of different ways and also with memberships of varying lengths from 1.5 hours up to three days. It doesn’t seem to make a difference.
However, I have now changed it again to run every minute, and I currently have four subscriptions set up… two of which I just started and which will end in 2 hours, and two of which were started yesterday and will end later today.
This doesn’t address the error that is being produced as pointed out by my host provider (pasted again below) and doesn’t explain why the reminder emails are being sent and received only when I log into wp-admin… that’s not a model that is sustainable.
Please explain.
Cheers,
Oliver
===========
We are still getting error message when we manually run the cron job.Please check the script at your end as mentioned earlier.
—
[root@cwh26 ~]# php -d display_errors /home/alecccwh/public_html/cron.phpWarning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/alecccwh/public_html/cron.php on line 16
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/alecccwh/public_html/cron.php on line 22
[root@cwh26 ~]# -
at #81794osuthernsMember
Following up on your suggestion to change to 1 minute intervals for the Cron Job.
6:35am – 2-hour subscription created.
7:35am – reminder #1 scheduled (1 hour before expiry) – NOTHING received.
8:05am – reminder #2 scheduled (30 minutes before expiry) – NOTHING received.
8:35am – 2-hour subscription ended.
9:10am – logged into wp-admin
9:12am – reminder #2 received followed immediately by reminder #1
I would very much like to get this resolved today, Mike. Client is not happy with the delays any longer.
Cheers,
O.
-
at #81795adminKeymaster
Hi Oliver,
I can understand that your clients is not happy, but sorry to say I’m not responsable for your hosting. And believe me it’s your server that is not executing. And I hope you understand that I cannot put my $100 bucks/hour server It guy to work to investigate your server and installation.
But maybe Easy cron is an option for you: https://www.easycron.com/?ref=72867
-
at #81796osuthernsMember
Yes I understand Mike.
But are you able to at least explain why the error is occuring, as the host is telling me that it is a problem with the script, and also why emails get sent out when I login into wp-admin?
Cheers,
Oliver
-
at #81797Helen (staff)Keymaster
Hi Oliver,
Like Mike told you in his previous post, the error can only be explained by investigating your server and installation. And, it seems your server is only excecuting and sending email reminders (running the script) when you login to your website.
-
at #81807osuthernsMember
Hi Helen.
This is definitely a question for you folks. I am still trying to sort things out to get your plugin working properly (ie. having email reminders sent out automatically).
I have set up a test product with a 2 hour time limit, with ONE reminder set to be sent with 1 hour remaining.
However, now that I have “purchased” the product, when I look at my list of subscribers (see attached), it shows TWO reminders being scheduled… the second one, however, for a time four hours before the start of the subscription.
Can you explain this to me, please?
Cheers,
OliverAttachments:
-
at #81809adminKeymaster
Share a screenshot of the product with the reminder settings
-
at #81810osuthernsMember
Here you go.
Attachments:
-
at #81812osuthernsMember
Hi Mike.
The host has added a php info page and asked me to send you the following link to see if any of the current settings and/or modules need to be modified or enabled…
-
at #81815Helen (staff)Keymaster
Hi Oliver,
Of course we understand you want the plugin working properly on your website.
We love to have happy clients of our products.Most buyers of UM-Switcher have their plugin up and running, and we do not need to support them at all on the forum.
There are several buyers that aren’t able to get it up and running properly though, and we’re always trying to help. However, issues also can be caused by not proper installing the plugin or because of server issues (mostly caused by budget/shared hosting).
A good basis is required (good hosting on a solid server) for websites where members can register, subscribe and make payments and receive email reminders.
The ”item support policies on Themeforest and Codecanyon” also state that item support does not cover installation of the item and hosting, server environment, or software. This is very understandable and logical, as investigating installations and server settings of buyers can easily take more than a few hours.
This means that researching and checking your website and server by or support staf and/or programmer can easily cost us 10 times the amount you’ve paid for item. If you do want to hire us, you can use the appropriate contact forms on our website and we will come up with an appropriate quote soon as we can.
Thank you very much in advance for understanding,
Helen
-
at #81816osuthernsMember
That’s unfortunate, though understandable. I was hoping we were getting close when Mike asked me to post a pic of the reminder settings.
That didn’t provide any clues, I guess?
I am surprised that two weeks into helping me out, I am only now reading a comment about shared hosting sometimes being a problem. The site is in a shared hosting environment. The client is an educational and cultural association of Canada that operates on a limited budget so a move to a non-shared environment would be significant.
What assurances do I have that the plugin would work as expected in a dedicated environment?
I’m not a scripter, but I am honestly surprised that given the Cron Job is throwing a clear error, it’s not easier to identify the problem / conflict / solution.
Cheers,
Oliver
-
at #81817adminKeymaster
Oliver,
It’s all about money, if we have to do research on servers it can be a time-consuming process. Cost that we never get from selling a plugin from $35,–. I want to give the best support ever but it’s just to freaking costly.
I had the same thing as you on one of my own client in the Swiss dismorning. You have set only 1 reminder, but on the subscription page you will see 2.
Well when you look into the database, you will see: dontsend at the field of reminder 2.
So there is no issue sending it out. I think but still searching that this is an issue with the cronjob.I’m still fighting with this hosting provider, as it’s on a shared hosting server and the cronjob is working for 90%, however the server keeps sending emails that the cron.php can’t be found. But were 100% sure that the path to the file is okay, we can access the cron.php via the browser but again next issue: it’s giving an warning: Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in
They say it’s suitable for WordPress, but I see errors on Woocommerce checkout even with non umswitcher products.
I have been working on this server since yesterday, talking with there hosting provider etc etc. Testing and testing, as always, I think it’s my umswitcher problem. It’s a fairly new plugin so bugs may appear until every server in the world is debugged. But in this case, we don’t have issues on our own dedicated servers. And a lot of clients don’t have this issue.
But anyway, If I find something I will keep you posted. For now, you don’t have an issue as the reminder 2 will not be send.
-
at #81818osuthernsMember
Thanks Mike.
Sounds like the same issue. Which to me means it’s worth solving… 😉
Oliver -
at #81839osuthernsMember
Hi Mike.
We had some success.
My host identified the line of code that was seemingly causing the error. (See pasted below). This appears to have worked. I have run test products over the last few days and I have received the expected reminder emails.
HOWEVER… as of yesterday (with no further modifications to the site or the script since May 20th, there is a different problem.
When I purchase a product (either as an existing subscriber to extend, or as a new subscriber) the purchase shows up as an order in WooCommerce but does NOT appear as a SUBSCRIBER in UM-Switcher.
What could possibly cause this? I am sure it is not related to the Cron Job and I am at a loss as to why this would suddenly start happening without my making changes.
Please advise as soon as possible. I thought we had solved the problem and then this new problem cropped up.
Cheers,
Oliver
=================
FROM HOST:We replaced the result variable
($result = mysqli_query($conn, $sql);)
with following:—
$result = mysqli_query($conn, “SELECT * FROM wp_users JOIN wp_um_switcher ON wp_users.ID = wp_um_switcher.user_id”);
—This script skips using “sql” variable, and instead directly use the values from the database.
========================= -
at #81841adminKeymaster
Hi Oliver,
An existing client will not have a new line of subscription, it will update the current one.
However, a new one should appear in your list.Why this is happening on your installation I can’t say, it’s already a weird situation that you need alter the code to have email reminders working. At our end and over 100 installations it’s working fine.
I have seen no subscriptions, if the Wp Time zone was set to UTC instead of a city, but we talked already about this.
-
at #81842osuthernsMember
Please see attached screenshots.
You can see that order # 1085 (which is the same product as order # 1069 and ordered by the same user) does not appear in the subscriptions list. I would expect to see the subscription updated to reflect the new purchase (showing an end date of three days from now – 29th).
Other products are working (seemingly) and will appear in the subscription list, but the three products that I have been testing (a 2 hour subscription and two three day subscriptions) have stopped working.
Thanks Mike
Attachments:
-
at #81845adminKeymaster
If you have set the product with 3 days access, yes It should display the latest end date. But I really can’t say were to look. This is something that needs to be looked in on server/database level.
-
at #81846osuthernsMember
Hi Mike.
That’s unfortunate. I’ve now run into two significant issues that the author of the plugin is not interested in resolving.
That is disappointing.
What do you recommend as an alternative solution to UM-Switcher if I can’t resolve this issue myself?
I am currently in the process of deleting the products that have stopped working in order to recreate them.
Thanks,
Oliver
-
at #81847osuthernsMember
Perhaps this will help?
I just changed the default message in the reminder email to the text below and the product stopped working. Do you see anything wrong with what I have used as text in the subject or body that would prevent the product as showing up as a subscription?
SUBJECT:
Your ONE YEAR membership in [site_name] will expire soon.BODY:
Hello [user],
[new_line]
This is a reminder that your membership in ALECC will expire in TWO DAYS.
[new_line]
Your continued support of the organization is important to us; to renew your membership, please visit http://www.alecc.ca/my-account/. Simply log in with your username and password and extend your membership for 1, 2, or 3 years.
[new_line]
Your username is your email address.
[new_line]
Your temporary password is a1l2e3c4c5.
[new_line]
Thank you for your support.
[new_line]
[site_name] -
at #81848osuthernsMember
Just confirmed that changing back to the default text returns the product to a working state.
So, what’s wrong with the text that I want to use?
Cheers,
Oliver
-
at #81849Helen (staff)Keymaster
Hello Oliver,
First of all, we’re sorry you’re having issues getting your UM-Switcher up and running.
We’ve supported only a few customers on this forum, and 95% of all buyers never contacted us.
This means our product is working properly.For us, this is also very frustrating.
We already explained, we cannot spend hours on your issues, installation, server without charges. At this point our cost already exceed the cost of your product many, many times, and we’re still answering your posts.
You/your hosting company made adjustments to the code, we’re not responsible for third party customizations and we don’t need to check their code.
I also refer to the item-support policy of Codecayon which is very clear about item-support.
Please read: https://codecanyon.net/page/item_support_policy
Support from developers regarding customizations (by you or us), installations and Hosting, server environment, or software are not covered. In such cases you can request a quote from the author.
Kind regards,
Helen
-
at #81850osuthernsMember
I understand Helen.
I’ve established that my problem with the products not appearing as subscriptions in UM-Switcher is connected to changing the default text of the reminder emails.
Can you just tell me if this is something you’ve experienced before or if you spot anything in my new text that might be problematic?
For example… is there a limit to the number of characters that can be used? Or any fields that MUST be included in order for the purchase to show up as a subscription?
Much appreciated,
Oliver
-
at #81851osuthernsMember
Hi there.
An update… when I remove the last two lines of my body text:
[new_line]
[site_name]the product works again.
I would love an explanation as I need to know what the limits are that I need to work within for the creation of these reminder emails.
Thanks.
-
at #81963lazormishMember
I am getting 2 error messages related to Cron Job:
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/sahbar5/public_html/wp-content/plugins/um-switcher/cron.php on line 22
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/sahbar5/public_html/wp-content/plugins/um-switcher/cron.php on line 29
I’ve tried everything. Looks like a coding problem. Have you run into this before?
-
at #81964lazormishMember
Here are more warnings I just got when I tried to purchase a subscription:
Attachments:
-
at #81966osuthernsMember
OK, thanks.
When do you think you might have these issues resolved?
Thanks,
Oliver -
at #81967osuthernsMember
Sorry… wrong response lazormish. Yes, my cronjob is returning the same errors. Has not been resolved yet.
-
at #81968adminKeymaster
Hi Lazormish.
Please create your own post, so we can track issues. -
at #81970lazormishMember
Sorry about that! I’ve just done that. Thank you!
-
-
AuthorPosts
- You must be logged in to reply to this topic.