timotheemoulin
Forum Replies Created
-
Forum: Plugins
In reply to: [Loco Translate] Compatibility with WC 8.0.2 and WP 6.3Hello @timwhitlock ,
Although it doesn’t have errors, PHPCS is still triggered by the has_magic_quotes function.
Could you update if to tell PHPCS to ignore the line as the PHP version check is done manually to avoid error?
private static function has_magic_quotes(){ // phpcs:ignore -- PHP version is checked prior to deprecated function call. return version_compare(PHP_VERSION,'7.4','<') && ( get_magic_quotes_gpc() || get_magic_quotes_runtime() ); }
Same in the
DebugController
line 158 and following.if( version_compare(PHP_VERSION,'7.4','<') ){ // phpcs:disable -- PHP version is checked prior to deprecated function call. if( get_magic_quotes_gpc() ){ Loco_error_AdminNotices::info('You have "magic_quotes_gpc" enabled. We recommend you disable this in PHP'); } if( get_magic_quotes_runtime() ){ Loco_error_AdminNotices::info('You have "magic_quotes_runtime" enabled. We recommend you disable this in PHP'); } if( version_compare(PHP_VERSION,'5.6.20','<') ){ Loco_error_AdminNotices::info('Your PHP version is very old. We recommend you upgrade'); } // phpcs:enable }
Forum: Plugins
In reply to: [Nested Pages] Nested pages does not recognize the Archived Post StatusThe problem comes from this file app/Views/partials/tool-list.php.
The filters on the top of the page are hard coded which doesn’t allow any other plugin to interact with and add custom post statuses.And statuses are also hard coded here : app/Entities/Listing/ListingQuery.php::getPosts()
- This reply was modified 4 years, 5 months ago by timotheemoulin.
@gardenzwerg Did you try my solution? Just add the code in your functions.php file to see if it solves your problem.
Forum: Developing with WordPress
In reply to: Gutenberg Headings Block … Remove H1, H3, etc as OptionsI personally ended up disabling the core/heading block and created a new one with a RichText component so I can style it.
Forum: Plugins
In reply to: [Login Lockdown & Protection] Normalize the plugin codeI just checked and I don’t see any issue on a frontend embedded login form.
Forum: Plugins
In reply to: [Login Lockdown & Protection] Possible problem related to Login LockdownHere is the indepth explanation.
On line 428, you try to replace the
WP_PLUGIN_DIR
from the__FILE__
path with theactivate_
prefix.As the WP core and most extensions are developped on UNIX like servers, plugins (and core) almost always use UNIX style directory naming
/path/to/my/folder
which introduce errors in path search and replace functions.Here is how is defined the
WP_PLUGIN_DIR
constant.if ( ! defined( 'WP_PLUGIN_DIR' ) ) { define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // Full path, no trailing slash. }
So when you use the
WP_PLUGIN_DIR
constant in your code it is like if you were using this (from the root dir (wp-load.php).__DIR__ . '/' . 'wp-content' . '/plugins'
which on a Windows based server would look likeC:\www\my-wordpress-project/wp-content/plugins
.Here is why you cannot use any of the WP directory constants for search and replace without first ensuring that both strings are using the same directory separator character.
Moreover you are already using
register_activation_hook( __FILE__, ...)
for your multidomain activation. Which in my opinion is the easiest way to go.https://developer.www.ads-software.com/plugins/plugin-basics/activation-deactivation-hooks/
This function is only a simple wrapper for the hook registration.
function register_activation_hook( $file, $function ) { $file = plugin_basename( $file ); add_action( 'activate_' . $file, $function ); }
- This reply was modified 4 years, 10 months ago by timotheemoulin.
Forum: Plugins
In reply to: [Login Lockdown & Protection] Possible problem related to Login LockdownThis is because the
WP_PLUGIN_DIR
variable contains both forward and backward slashed on a Windows server.When registering the action hook with this method, I cannot make it work on WAMP, but it runs smoothly on an LAMP setup.
Registering the hook with
__FILE__
instead solve the issue as this will only contains one type of slash.Forum: Plugins
In reply to: [Login Lockdown & Protection] Normalize the plugin codeHey!
Yeah that’s not only about normalization. They’re also some fixed that might be needed especially regarding the plugin activation that doesn’t work on a windows server.
Let me know of you have some times to setup an issue tracking list that we can collaborate on.
Forum: Plugins
In reply to: [Login Lockdown & Protection] Normalize the plugin codeIf you are interested in a collaboration, here is my fork repository.
Forum: Plugins
In reply to: [Login Lockdown & Protection] Possible problem related to Login LockdownIt is the same error as the one already mentioned for the directory separator character.
Here is the line that you should use to trigger the plugin activation `register_activation_hook(__FILE__, ‘loginlockdown_install’);
`https://www.ads-software.com/support/topic/problem-with-activation-3/
I’m working on a reviewed version of your plugin. I hope you’ll consider merging it sometimes.
Using CSS to add the space is really tiring. The currency can be added in multiple places (product list, details, search results, custom blocks, sidebar, generated PDF product page …). If you have to add a different space depending on the font size and weight everywhere you will endup missing some place.
Moreover, you’ll have to do it again if you change your style.
Using a simple snippet as provided here above will do the trick and will be far more efficient.
Here is what I use so I can handle multiple currencies ($ without space, CHF and € with space.
function tim_wc_add_space_currency( $currency_symbol, $currency ) { if ('CHF' == $currency) { $currency_symbol = 'CHF '; } return $currency_symbol; } add_filter('woocommerce_currency_symbol', 'tim_wc_add_space_currency', 10, 2);
@factmaven any news on the next release date?
@caseproof this is actually quite annoying on a dev environment as the admin screen becomes useless when notices are triggered.
Do you have an open git so we can help you with pull requests?
Cheers
Forum: Plugins
In reply to: [Nested Pages] WPML translation syncForum: Plugins
In reply to: [Nested Pages] Open basedir restriction