digitoimistodude / air-helper Goto Github PK
View Code? Open in Web Editor NEWAir helper brings our preferences to Air-light based themes and extends with many ways like adding WooCommerce support.
License: MIT License
Air helper brings our preferences to Air-light based themes and extends with many ways like adding WooCommerce support.
License: MIT License
Do something similar for setting our preferred Polylang settings after installing it, that we do for The SEO Framework.
Some things to put into default settings:
Anything else @ronilaukkarinen, @EliasKau, @Tumppex?
Currently, you need to know that we limit the domains to which emails can be sent when in development and staging environments. When the receiving address is not in that domain, the to-address is forced to be ours.
We probably should show visible reminder about this on the dashboard since this doesn't affect us but can cause issues for developers that aren't from our company. The notice could be dismissible.
Why notice instead, for example, defaulting the forced address to admin_email
? Because when working on a site that has been in production already, that email can be clients instead of ours.
I've also thought about detecting if we're on Dude dev or stage env, to put the email forcing on only in those situations. But haven't yet come up with a solution that would be reliable.
Thoughts @ronilaukkarinen @EliasKau?
If using for example get_option( 'page_for_posts' ), blocks will not load up:
<?php the_block_content( get_option( 'page_for_posts' ) ); ?>
Instead if we use absint it works:
<?php the_block_content( absint( get_option( 'page_for_posts' ) ) ); ?>
Air-helper should be improved so that it checks whether there's string or int.
We should change the default messages when logging in fails. From the message, you should not be able to determine if the username was correct or not.
Currently plugins.php is removed from menu if user email domain is not on the list provided. List can be altered via hook.
This approach isn't really suitable for big organizations. We need to allow plugins.php visibility for specific singular users. It can be done by using user_meta
.
Line 184 in 8ce7b63
Carbon Fields is no longer used in our projects so support for it should be dropped off from air helper. Same goes to post meta revision support, which was introduced in support for CF previews.
Copy files and functions to own plugin which will be added as a MU for clients using CF.
Turn off Imagify backup automatically.
WordPress 5.7.2 outputs things like this:
<link rel="https://api.w.org/" href="//localhost:3000/wp-json/" /><link rel="alternate" type="application/json" href="//localhost:3000/wp-json/wp/v2/pages/701" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="//localhost:3000/wp/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="//localhost:3000/wp/wp-includes/wlwmanifest.xml" />
<link rel="alternate" type="application/json+oembed" href="//localhost:3000/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fairdev.test%2F" />
<link rel="alternate" type="text/xml+oembed" href="//localhost:3000/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fairdev.test%2F&format=xml" />
These cause invalidity errors like this:
18:1-76 error Bad value “https://api.w.org/” for attribute “rel” on element “link”: The string “https://api.w.org/” is not a registered keyword.
My suggestion is to remove these with:
/**
* Remove WP REST API json links in <head> html
*/
remove_action( 'wp_head', 'rest_output_link_wp_head' );
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
remove_action( 'template_redirect', 'rest_output_link_header', 11 );
Example with WordPress native functions:
<picture>
<source media="(min-width: 320px) and (max-width: 767px)" srcset="<?php echo esc_url( wp_get_attachment_image_url( $item['image'], 'medium' ) ); ?>">
<source media="(min-width: 768px) and (max-width: 1199px)" srcset="<?php echo esc_url( wp_get_attachment_image_url( $item['image'], 'large' ) ); ?>">
<source media="(min-width: 1200px)" srcset="<?php echo esc_url( wp_get_attachment_image_url( $item['image'], 'full' ) ); ?>">
<img
loading="lazy"
src="<?php echo esc_url( wp_get_attachment_image_url( $item['image'], 'large' ) ); ?>"
alt="<?php echo esc_attr( get_post_meta( $case_study['image'], '_wp_attachment_image_alt', true ) ); ?>"
>
</picture>
Parameters that need to be changed optionally:
aria-hidden="true/false"
depending on whether the image is decorative or notmedia
, in case if there's a different sized area that does not work for the "default" sizes, for example medium 300px gets smudged when stretching to 400px area.It should be able to add alt or aria-label for images. If not set manually, get text from WordPress media alternative text.
After installing the plugin, the menu in admin area is broken. The section "Design" dissapears.
Plugin Version: 2.18.0
Wordpress: 6.1.1
Add and enqueue instant.page
Copy functions get_post_years
, get_post_months_by_year
from the client project.
Add help to every screen on dashboard
Add dashboard widget for latest updates from agency and functionality to show reminder about scheduled maintenance.
Get Polylang license key from .env variable. Also, warn if it is not set and site is in the upkeep.
remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
Imagify api key, max image size, compression level and admin bar tool settings should come automatically to default values via hooks.
See https://github.com/wp-media/imagify-plugin/blob/e914395a5b582c7b4e1798eee7bd08d088e67d1b/inc/classes/class-imagify-abstract-options.php#L165 to get idea how to change the options.
In most of our projects, there's really no need for most of the default archive views that WordPress haves. Sometimes in hurry, those might end up being forgotten and looking really bad (unstyled).
I'm considering disabling search view, tag, category, author and date archives by default. Every view could be de-disabled via hook in theme or plugin. In the name of backward compatibility, if added to plugin, we need to check if plugin version is earlier than X and do de-disable automatically.
Opinions @ronilaukkarinen and @artotoivanen?
Media dir is not updated currently, need for improvement.
Before releasing 2.9.0, update the documentation where needed.
Force honeypot on for all forms made with Gravity Forms.
Considering add lazy loading attribute to img tag for browser who support it, otherwise load the lazyload js.
Something like:if ( // check if browser support lazy loading attribute ) { } else { // browser doesn't support it, so load the lazyload js }
As it explained here: lazy loading article
Although current caniuse still around 70%: caniuse
I think it would be great if it was implemented by default without needing to edit the JS every time we set up the starter theme.
Sometimes ACF does not save the JSON file of the field group for one reason or another. We should warn about this big time, as field groups can be easily lost from the database and having acf-json as a backup is essential.
By default, we move scripts including jQuery to the footer of the site. This breaks Gravity Forms, as it tries to use jQuery before it's actually loaded.
For now, this has been fixed project by project when needed but having fix always there would make sense. Ensure that fix is only applied to new projects.
The fix could be something like
add_filter('gform_init_scripts_footer', '__return_true');
add_filter( 'gform_cdata_open', __NAMESPACE__ . '\wrap_gform_cdata_open' );
function wrap_gform_cdata_open( $content = '' ) {
$content = 'document.addEventListener( "DOMContentLoaded", function() { ';
return $content;
}
add_filter( 'gform_cdata_close', __NAMESPACE__ . '\wrap_gform_cdata_close' );
function wrap_gform_cdata_close( $content = '' ) {
$content = ' }, false );';
return $content;
}
Fatal error: Uncaught Error: Call to undefined function is_plugin_active() in mail-delivery.php:25
Instead of
<?php native_lazyload_tag( $image_id, [ 'sizes' => [ 'big' => 'thumbnail' ] ] ) ?>
We could just
<?php native_lazyload_tag( $image_id, 'thumbnail' ) ?>
Thought I should let you know that I get this warning when overriding this with user meta and the override wont work:
( ! ) Warning: Undefined variable $menu_links in \content\plugins\air-helper\inc\admin\acf.php on line 28
Adding $menu_links
in function air_helper_maybe_hide_acf()
or changing this if ( 'true' === $meta_override ) { return $menu_links; }
to this if ( 'true' === $meta_override ) { return true }
fixes it.
Currently, there's no way to revert media library settings back to WP default's.
This could be better in its own plugin, but let's see. I'll just mark the idea here. Copy functions get_post_type_date_link
and init hook function client_blogi_yearmonth_rewrite
from client project and make those more dynamic and robust.
Woocommerce isn't used on most of the client cases so it's un-neccessary to have few functions of modifications in air helper. Also in most of the client cases with Woocommeece extensive cutomisation is needed nevertheless.
Currently there are few huge files containing all functionality. Split the files to smaller ones and order functionality based on affected area. Escpecially hooks.php and functions.php do need work.
Copy primary category get from latest project.
For backward compatibility reasons, we should create a new plugin which has all the Carbon Fields and post meta revision functionalities that are being removed on version 2.0
Setup The SEO Framework default settings so that we don't need to do that every time activating the plugin.
WordPress 5.5 introduced native lazyloading. We have our own at the moment, so native onde should be disabled with add_filter( 'wp_lazy_loading_enabled', '__return_false' );
Currently there's no hook to enable admin bar on frontend outside development envarioment if needed. Add hook to allow that.
In some cases, order by alphabetical fixes do not work because called too late. Move those to priority flight.
For backward compatibility reasons, we should create a new plugin which has all the WooCommerce functionalities that are being removed on version 2.0
Some clients find it hard to find where to update their site navigation. On the other hand, they don't need to access themes, widgets or customizers nearly at all.
For these reasons, we should consider hiding themes.php and adding nav-menus.php to the top level of the dashboard menu for client users.
Sometimes we have scenarios where the website doesn't use Polylang but we still use translatable strings via inc/includes/localization.php. It would be nice to have a way to update localizations when needed without having to hardcode them into the file.
Warn if HS_BEACON_ID env variable is not set and site is in the upkeep.
Allow enabling/disabling password protected posts.
Admin bar is really usable when editing the site. Benefits of it overrule the small design implications that the admin bar has. Thus bring back admin bar, but remove all un-necessary things from it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.