dewd
Forum Replies Created
-
Until a fix is implemented aynatural59’s answer works to hide the error.
I have this exact error every week getting logged in error_log
[08-Sep-2024 23:59:02 UTC] Cron reschedule event error for hook: wpforms_weekly_entries_count_cron, Error code: could_not_set, Error message: The cron event list could not be saved., Data: {“schedule”:”wpforms_weekly_entries_count”,”args”:[],”interval”:-3542}
Hi @paapst It has only partly solved the problem, i.e. it’s provided an API only. Unless I hardcode the link into the theme, I have to build an interface to allow end users to change using a field, either linked to a specific theme or via a stand alone plugin. Is there a way I can extend the cmplianz settings page to add this as a field? This would be the most ideal solution. In any case, at least I’ll earn a tiny bit of cash code this. Many thanks Paul
Hi
The filter works fine thanks.
Paul
I’ll let you know as soon as I give it a go. Appreciate your helpfulness. ????
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Add custom document CSS not workingI’ve added the CSS to the Theme. Obviously not ideal but a workaround nonetheless.
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Add custom document CSS not workingCould the lack of CSS be because the page is loaded via wp-json. I don’t see why it should because the page is still rendered on the server side. For this page the json comes from here: https://tioray.wp.web-dewd-dev.co.uk/wp-json/wp/v2/pages/59?cache=1583327728904 I see that the following console logs are written prior to the this json request being made:
- opt-in cookieconfig.min.js:1:9720 - fire cmplz_event_functional cookieconfig.min.js:1:7663 - fire statistics cookieconfig.min.js:1:7016 - fire cmplz_event_all cookieconfig.min.js:1:7663 - enabling cookies tioray.wp.web-dewd-dev.co.uk:141:14 - fire statistics
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Add custom document CSS not workingHi
I have made that change (schoolboy error). The Custom document CSS now reads as follows:
#cmplz-document h3 { color:#333; font-size:14px; font-weight:700; }
You will see from https://tioray.web-dewd-test.co.uk/#!/cookie-policy-eu/144 that the CSS is still not loading.
Forum: Developing with WordPress
In reply to: Theme Amending PermalinkDon’t worry, this isn’t anywhere in the open market, neither will it ever be. It’s at the behest of a private client. A theme has been built specifically for their purposes.
The reason we want the default permalink to be the post name is because WordPress and the theme are deployed to multiple environments and sometimes get reinstalled from scratch. Automating the permalink change just removes a manual process.
WordPress used to automate this rewrite to
.htaccess
andweb.config
on install, defaulting permalinks to post name. It now defaults to post id.It is highly unlikely this is to do with the running order, since it’s something which works with the
htaccess
config file in a *nix environment, but not theweb.config
file in a Windows environment (my problem).P.S. Just to politely clarify, this action does not cause theme lock in. All it does is automates the manual action of changing permalinks under settings. Manually changing permalinks using the default interface, under settings updates the rewrites in either
htaccess
orweb.config
as appropriate. It’s a core WordPress process. I just don’t know why it works on Windows with a manual update and not an automated one as documented by WordPress.Forum: Developing with WordPress
In reply to: My plugin needs to run an overnight processDone! ????
Forum: Developing with WordPress
In reply to: My plugin needs to run an overnight process@diondesigns I posted my question on Stackoverflow before here: https://stackoverflow.com/questions/55166411/command-line-run-and-flush-output-from-wordpress-plugin-function. If you would like to answer it, I’ll give you a +1 and a ?
Forum: Developing with WordPress
In reply to: My plugin needs to run an overnight process@diondesigns perfect. ????
Just an FYI for anyone reading this. If you need to use
wp_mail
, unfortunately it creates aNotice
for global$_SERVER['SERVER_NAME']
beingundefined
. I manually set this to an empty string, in my set up file and it works fine.Forum: Developing with WordPress
In reply to: My plugin needs to run an overnight processMarvelous stuff @diondesigns . Yes, I wouldn’t put the batch file in the website path. Do you know if there a way of loading the core without loading plugins?
Forum: Developing with WordPress
In reply to: My plugin needs to run an overnight processWordPress functions are used. As part of the batch process the following are used:
Create instance of plugin class –
__construct
runs variousadd_action
andadd_filter
items. I suppose I could remove these from__construct
and only run them as part of plugin load e.g.:add_action( 'init', function(){ $object = new Plugin_Class(); //curretly in __construct $object->initialise(); }, 10);
Doing the plugin load this way would theoretically mean I wouldn’t have to run
$object->initialise()
for the batch process.After object creation:
global $wpdb
used throughout
$wpdb->prefix
$wpdb->insert
$wpdb->update
$wpdb->get_row
$wpdb->get_results
$wpdb->query
$wpdb->get_var
other:
get_bloginfo
get_option
get_pages()
get_post()
get_shortcode_regex()
wp_mail
What do you think?
Forum: Developing with WordPress
In reply to: My plugin needs to run an overnight processThanks for your suggestion. The main issue with using
wp_schedule_event()
is that it is only executed when someone visits the site:The action will trigger when someone visits your WordPress site if the scheduled time has passed.
This wouldn’t work well because the browser would hang whilst the batch process executed. It would probaly timeout because the batch could take a while to execute.
Ideally there would be a stable equivalent of WP-CLI which would allow specific functions within plugin classes to be executed in the same way that wp-json allows.
I’m going to expand on @jdembowski suggestion. I’m going to build a wrapper which controls the number of items which need processing, and have the wp-json process only one item at a time. This should prevent hanging and also flush the buffer on an almost immediate basis. It will be easy to run as a batch process on either Windows or Linux. IT’s not ideal having to use wp-json out of context, but I cannot see any other way right now.
Many thanks.