Fleuv
Forum Replies Created
-
Forum: Plugins
In reply to: [Contact Form 7] POST request contact form 7 routeIt seems like you’re required to authenticate before using the REST API endpoints of contact form 7. This is quiet a challenge if you’re not working inside the WordPress environment (as it is in my case).
To be able to receive data from the wpcf7 REST API endpoints you will need to authenticate with the WordPress REST API. Note that this is not done automatically after logging in, you will also need to generate a nonce as following:
wp_create_nonce( 'wp_nonce' );
. Every request you make to the API should include aX-WP-Nonce
header with that nonce key.To generate a nonce while working in the WordPress environment it should not be a problem because you can call this function. If you’re working in another environment like me than you will probably have to create an extra endpoint to retrieve the nonce.
Forum: Fixing WordPress
In reply to: Render a templateHello Joy,
Thank you for your reply.
There are already libraries like Mustache to do this
Could you please give a general explanation of what the Mustache library is capable of? I tried to search for it but got irrelevant results I guess.
this is actually what a theme is already doing, but without a middleman function.
The function is actually not much like a theme as far as I can tell, you can call it a sort of wrapper function if that is what you mean by “middleman function” however it does also come with it’s own logic for organizing template files and setting up open and close identifiers for the placeholders used in the template. And of course last but not least customizing replacements through hooks.
the post content contains paragraphs, so putting it in a paragraph would produce invalid syntax.
This is not completely true, the content initially doesn’t include paragraphs. Of course it does if you add a paragraph to the content through e.g. the content editor. However the code above is just an example, the issue could be solved by writing
<div>{post_content}</div>
instead.I’m not sure it’s a good idea to recursively call the function to grab the post data.
The post data is cached and thus it wont affect the performance of your site concernedly. Of course you should be careful as you add more items to the replacements array and use the function a lot of times recursively, then this will drag the performance down eventually. To clarify: when executing the
preg_replace()
function about +1.000.000 with an array of about 100 replacement patterns. It will drag the response time down by 5 seconds. I don’t think any website will use the function in such extend.But how about Mustache how do they do it, does it affect the performance drastically?
Forum: Plugins
In reply to: [Premium Seo Pack - Light Version] This Plugin Do Not Support PHP 7.0Subscribing.
For me too, here is the error I get on the homepage after installing (v1.1.0) it.
Fatal error: Uncaught Error: Call to undefined function eregi_replace() in /var/www/example/wp-content/plugins/premium-seo-pack-light-version/modules/title_meta_format/init.php:124 Stack trace: #0 [internal function]: pspTitleMetaFormat->head_title_tag('<!doctype html>...', 9) #1 /var/www/example/wp-content/plugins/premium-seo-pack-light-version/modules/title_meta_format/init.php(112): ob_end_flush() #2 /var/www/example/wp-includes/plugin.php(525): pspTitleMetaFormat->head_after('') #3 /var/www/example/wp-includes/general-template.php(2528): do_action('wp_head') #4 /var/www/example/wp-content/themes/example/header.php(16): wp_head() #5 /var/www/example/wp-includes/template.php(572): require_once('/var/www/probeg...') #6 /var/www/example/wp-includes/template.php(531): load_template('/var/www/probeg...', true) #7 /var/www/example/wp-includes/general-template.php(45): locate_template(Array, true) #8 /var/www/example/wp-content/themes/example/page.php(1): get_header() #9 /var/www/example/wp-includes/template-loade in /var/www/example/wp-content/plugins/premium-seo-pack-light-version/modules/title_meta_format/init.php on line 124
—–
The “premium” plugin (v1.9.1) on codecanyon does an even worse job at supporting php7. Immediately after activation the following error will be visible at all pages of the wordpress install.
Fatal error: 'continue' not in the 'loop' or 'switch' context in /var/www/example/wp-content/plugins/premium-seo-pack/modules/sitemap/init.php on line 801
Forum: Hacks
In reply to: Avoiding the use of wp-login.phpBy filtering logout_url you’ll be able to change the URL. But not every custom URL has a statement or something, scripted on custom.php?action=logout
I’ve found out how to change it but I decided to leave it behind, but perhaps I’ll comeback later on it.
This answer is explaining what I’m trying to say. Only I don’t know if it works correctly
Forum: Fixing WordPress
In reply to: JavaScript/jQuery isn't working in the admin panelI’ve found the plugin what is causing the problem. By activating and deactivating all my plugins I found out that jQuery & javascript did work when all plugins where activated except the plugin: “Romtek Pro Google Analytics Tools”. The plugin is by Romtek -> https://romtekdev.com/
Forum: Fixing WordPress
In reply to: JavaScript/jQuery isn't working in the admin panelWell this might solve my problem but the site wouldn’t remain like it was.
Forum: Fixing WordPress
In reply to: JavaScript/jQuery isn't working in the admin panelOke, I looked up in the google cache and there it says WP 3.4 (got that from the page source)