Shmoo
Forum Replies Created
-
Forum: Plugins
In reply to: [Cookie Notice & Compliance for GDPR / CCPA] Cookie notice plugin problemThis is only a problem in Safari browsers. All other browsers are less strict when defining an empty value.
Current code.
#cookie-notice.cn-animated.cn-effect-none { -webkit-animation-duration: 0s; animation-duration: 0s; }
Should be:
#cookie-notice.cn-animated.cn-effect-none { -webkit-animation-duration: none; animation-duration: none; }
Just wait for the developer to update this plugin, or change the code inside the following two files yourself.
./wp-content/plugins/cookie-notice/css/front.css
./wp-content/plugins/cookie-notice/css/front.min.cssForum: Fixing WordPress
In reply to: Any recent changes to wp_mail ?Got it fixed!
The headers ‘From: @mail’ had to be the address of the WordPress hosted domain. It could not be the address of the person filling out the form itself.
Webhoster/server strictness thingy, I believe. Hope this will help someone in the future.
??
Forum: Fixing WordPress
In reply to: Any recent changes to wp_mail ?SMTP Error: data not accepted.
After activating the wp_mail_failed debugging hook I get this error back.
https://developer.www.ads-software.com/reference/hooks/wp_mail_failed/—
The only thing I can think of is that maybe my headers aren’t valid because in this error log (picture) it’s an empty Array. The Codex doesn’t mention it must be an array, it says string or array.
For me it’s just a string. Could this be the problem?
$headers = 'From: '. $email . "\r\n" . 'Reply-To: ' . $email . "\r\n";
Forum: Fixing WordPress
In reply to: Change data.attachment in wp_print_media_templatesGot something via WordPressStackexchange.
https://wordpress.stackexchange.com/questions/268100/append-button-to-wordpress-image-details-modal/268145#268145function wpse_print_media_templates() { ?> <script> jQuery( document ).ready( function( $ ){ jQuery( "script#tmpl-image-details:first" ).remove(); }); </script> <script type="text/html" id="tmpl-image-details"> <div class="media-embed"> <div class="embed-media-settings"> <div class="column-image"> <div class="image"> <img src="{{ data.model.url }}" draggable="false" alt="" /> <# if ( data.attachment && window.imageEdit ) { #> <div class="actions"> <input type="button" class="edit-attachment button" value="<?php esc_attr_e( 'Edit Original' ); ?>" /> <input type="button" class="replace-attachment button" value="<?php esc_attr_e( 'Replace' ); ?>" /> </div> <# } else if ( ! data.attachment && window.imageEdit ) { #> <div class="actions"> <input type="button" class="replace-attachment button my-theme" value="<?php esc_attr_e( 'Replace' ); ?>" /> </div> <# } #> </div> </div> <div class="column-settings"> <?php /** This filter is documented in wp-admin/includes/media.php */ if ( ! apply_filters( 'disable_captions', '' ) ) : ?> <label class="setting caption"> <span><?php _e('Caption'); ?></span> <textarea data-setting="caption">{{ data.model.caption }}</textarea> </label> <?php endif; ?> <label class="setting alt-text"> <span><?php _e('Alternative Text'); ?></span> <input type="text" data-setting="alt" value="{{ data.model.alt }}" /> </label> <h2><?php _e( 'Display Settings' ); ?></h2> <div class="setting align"> <span><?php _e('Align'); ?></span> <div class="button-group button-large" data-setting="align"> <button class="button" value="left"> <?php esc_html_e( 'Left' ); ?> </button> <button class="button" value="center"> <?php esc_html_e( 'Center' ); ?> </button> <button class="button" value="right"> <?php esc_html_e( 'Right' ); ?> </button> <button class="button active" value="none"> <?php esc_html_e( 'None' ); ?> </button> </div> </div> <# if ( data.attachment ) { #> <# if ( 'undefined' !== typeof data.attachment.sizes ) { #> <label class="setting size"> <span><?php _e('Size'); ?></span> <select class="size" name="size" data-setting="size" <# if ( data.userSettings ) { #> data-user-setting="imgsize" <# } #>> <?php /** This filter is documented in wp-admin/includes/media.php */ $sizes = apply_filters( 'image_size_names_choose', array( 'thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size'), ) ); foreach ( $sizes as $value => $name ) : ?> <# var size = data.sizes['<?php echo esc_js( $value ); ?>']; if ( size ) { #> <option value="<?php echo esc_attr( $value ); ?>"> <?php echo esc_html( $name ); ?> – {{ size.width }} × {{ size.height }} </option> <# } #> <?php endforeach; ?> <option value="<?php echo esc_attr( 'custom' ); ?>"> <?php _e( 'Custom Size' ); ?> </option> </select> </label> <# } #> <div class="custom-size<# if ( data.model.size !== 'custom' ) { #> hidden<# } #>"> <label><span><?php _e( 'Width' ); ?> <small>(px)</small></span> <input data-setting="customWidth" type="number" step="1" value="{{ data.model.customWidth }}" /></label><span class="sep">×</span><label><span><?php _e( 'Height' ); ?> <small>(px)</small></span><input data-setting="customHeight" type="number" step="1" value="{{ data.model.customHeight }}" /></label> </div> <# } #> <div class="setting link-to"> <span><?php _e('Link To'); ?></span> <select data-setting="link"> <# if ( data.attachment ) { #> <option value="file"> <?php esc_html_e( 'Media File' ); ?> </option> <option value="post"> <?php esc_html_e( 'Attachment Page' ); ?> </option> <# } else { #> <option value="file"> <?php esc_html_e( 'Image URL' ); ?> </option> <# } #> <option value="custom"> <?php esc_html_e( 'Custom URL' ); ?> </option> <option value="none"> <?php esc_html_e( 'None' ); ?> </option> </select> <input type="text" class="link-to-custom" data-setting="linkUrl" /> </div> <div class="advanced-section"> <h2><button type="button" class="button-link advanced-toggle"><?php _e( 'Advanced Options' ); ?></button></h2> <div class="advanced-settings hidden"> <div class="advanced-image"> <label class="setting title-text"> <span><?php _e('Image Title Attribute'); ?></span> <input type="text" data-setting="title" value="{{ data.model.title }}" /> </label> <label class="setting extra-classes"> <span><?php _e('Image CSS Class'); ?></span> <input type="text" data-setting="extraClasses" value="{{ data.model.extraClasses }}" /> </label> </div> <div class="advanced-link"> <div class="setting link-target"> <label><input type="checkbox" data-setting="linkTargetBlank" value="_blank" <# if ( data.model.linkTargetBlank ) { #>checked="checked"<# } #>><?php _e( 'Open link in a new tab' ); ?></label> </div> <label class="setting link-rel"> <span><?php _e('Link Rel'); ?></span> <input type="text" data-setting="linkRel" value="{{ data.model.linkClassName }}" /> </label> <label class="setting link-class-name"> <span><?php _e('Link CSS Class'); ?></span> <input type="text" data-setting="linkClassName" value="{{ data.model.linkClassName }}" /> </label> </div> </div> </div> </div> </div> </div> </script> <?php } add_action( 'print_media_templates', 'wpse_print_media_templates' );
Forum: Fixing WordPress
In reply to: Change data.attachment in wp_print_media_templatesLittle bump..
Forum: Fixing WordPress
In reply to: Change data.attachment in wp_print_media_templatesThere are two different Media Modals (views) in WordPress which is a little crazy to begin with.
What I’m trying to do is basically – replace a placeholder image in the content editor for one inside the library.
1) I’ve created a custom modal button on the editor.
2) This will add a code snippet (html) to the editor.
3) The code snippet holds two placeholder images a user should replace with it’s own images.
4) Pressing the edit button on those placeholder images doesn’t let me replace the image because it’s not in the WP library and part of this post.https://www.ads-software.com/support/topic/two-different-media-modals/
—-
If I could only append this simple button in some way with jQuery to the Image Details Media Modal I’m fine.
<input type="button" class="replace-attachment button" value="Replace" />
- This reply was modified 7 years, 6 months ago by Shmoo.
After hours of searching online I’ve found something. Still not a 100% match for what I was looking for but at least it’s something and I can start building a little.
This will remove all images wider than 800px from the scrset.
// Remove sources wider than 800px from the 'srcset' for featured images. function custom_wp_calculate_image_srcset( $sources, $size_array, $image_src, $image_meta, $attachment_id ) { if ( array_key_exists( 'post-thumbnail', $image_meta['sizes'] ) ) { $post_thumbnail_file = $image_meta['sizes']['post-thumbnail']['file']; $image_src_file = wp_basename( $image_src ); if ( $image_src_file === $post_thumbnail_file ) { foreach ( $sources as $key => $source ) { if ( $source['value'] > 800 ) { unset( $sources[ $key ] ); } } } } return $sources; } add_filter( 'wp_calculate_image_srcset', 'custom_wp_calculate_image_srcset', 10, 5 );
Source:
https://devhub.io/repos/ResponsiveImagesCG-wp-tevko-responsive-images—-
Let’s hope I can alter this code a little bit with some conditional statements and filter out all the images not needed in the srcset.
Thanks but reading from there I can only find ways how to change/alter the max-width included to prevent people from adding 25mb image files + change all the media query stuff for targeting X images.
Nobody taks about removing image A, B, C from being echoed in the srcset because they are useless in a blog post anyway.
??
Forum: Plugins
In reply to: [Yoast SEO] Move Yoast Messages out of Publish AreaYou probably have to hide it by adding custom CSS to your backend.
Add this to your theme’s functions.php file.
function my_custom_css() { echo '<style> .misc-pub-section.yoast-seo-score.content-score { display: none; } .misc-pub-section.yoast-seo-score.keyword-score { display: none; } </style>'; } add_action( 'admin_head', 'my_custom_css' );
Forum: Plugins
In reply to: [Yoast SEO] Company or Person?I’ve always looked at it from this point of view.
If you sell something or you create invoices for the service your provide + you’re listed a company ( even if the company is your personal name ) you’ll choose company here.
If you blog, write about stuff you like or have personal website, even if the domain name isn’t your real name you choose person here.
Forum: Fixing WordPress
In reply to: White screen after overriding wp-admin and wp-includes1)
There is nothing to see, even when I activate the WP DEBUG and log functions. I’ve been creating sites with WP since 2007 I have seen white screens before and fixed them by simply renaming plugins or themes to activate default WordPress.3)
There I see an Error cased by WordPress SEO ( Yoast ) probably something to do with PHP 7 but I doubt this will make my site crash because it’s activated on so many sites.I mean, I have renamed my theme folder + the plugins folder of wp with 5 plugins inside, This would deactivate my theme and WP would fall back to use the Twentysixteen theme and also disable all plugins activated.
But nope. Still white screen.
I’ve contacted my hosting provider and they think I’m crazy. It’s like I’m the crazy person renaming WordPress folders to troubleshoot.? Did I miss anything over the last few years ?
I mean, I don’t have a lot of troubles with WordPress in general because I barely use plugins and always create my own themes trying to avoid any 3rd party code. Back in the days I learned this way to troubleshoot.
Forum: Plugins
In reply to: [WP Super Cache] https breaks Yoast SEO sitemap?I have removed this plugin for now..
Can’t get this to work, locally it works, on other domains it works with the same themes and plugins, and now as soon at I activate https it doesn’t work anymore.
I’ll check in a few months if this problem is still around. Thanks anyway.
Forum: Fixing WordPress
In reply to: Does disabling auto-update kill the entire cronjob system?Update
Looks like there is something wrong.
The future posts function also doesn’t seem to work so maybe that’s the issue here.
Forum: Fixing WordPress
In reply to: Does disabling auto-update kill the entire cronjob system?Thanks,
Strange thing is.. When I did this:
define( 'AUTOMATIC_UPDATER_DISABLED', true ); define( 'ALTERNATE_WP_CRON', true );
The plugin just works and starts doing it’s backups at X given time.
https://www.ads-software.com/plugins/backupwordpress/I’m going to do more testing.
Forum: Plugins
In reply to: [BackUpWordPress] Manual backups work but not automatic backupsI solved this problem by adding this.
define( 'AUTOMATIC_UPDATER_DISABLED', true ); define( 'ALTERNATE_WP_CRON', true );
The second line makes the auto-updates work again.