Changeset 3004853
- Timestamp:
- 12/03/2023 09:00:57 PM (16 months ago)
- Location:
- fcp-first-screen-css/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
fcp-first-screen-css/trunk/README.md
r2973720 r3004853 1 1 # First Screen CSS & Settings 2 2 3 This is a professional tool to manipulate enqueued styles and scripts on your website and add custom CSS to first screen and not first screen optionally. Use it to improve your Core Web Vitals score or just add custom styling.3 This is a professional tool to manipulate enqueued Styles and Scripts on your website; add custom CSS to the first screen and not first screen optionally, choose where to apply. Use it to improve your Core Web Vitals score or just add custom styling. 4 4 5 5 ## Features … … 9 9 * Apply changes to all posts of a specific type 10 10 * Apply changes to the blog or any post-type archive 11 * Inline, defer, or de-register Styles or JS 11 * Inline, defer, or de-register / disable Styles and Scripts 12 * Edit CSS easily with the CodeMirror visual editor 12 13 * Automatic CSS minification 13 * Edit CSS easily with the CodeMirror visual editor14 * Instructions to get CSS 14 15 15 16 ## Demo … … 20 21 21 22 * Install and activate the plugin. 22 * Navigate to " First Screen CSS" in the left sidebar of your wp-admin.23 * Click "Add New ."23 * Navigate to "CSS Settings" in the left sidebar of your wp-admin. 24 * Click "Add New" 24 25 * Input your CSS or adjust the settings. 25 * Choose where to apply the changes and publish. 26 * Choose where to apply the changes and Publish. 27 * Repeat to apply a different set of settings to other posts. -
fcp-first-screen-css/trunk/changelog.txt
r2973591 r3004853 1 = 1.7 = 2 3 * Added the option to apply Settings by Template 4 * Added useful functions to CodeMirror editor 5 1 6 = 1.6 = 2 7 -
fcp-first-screen-css/trunk/first-screen.php
r2985554 r3004853 2 2 /* 3 3 Plugin Name: First Screen CSS & Settings 4 Description: This is a professional tool to manipulate enqueued styles and scripts on your website and add custom CSS to first screen and not first screen optionally. Use it to improve your Core Web Vitals score or just add custom styling.5 Version: 1. 6.44 Description: This is a professional tool to manipulate enqueued Styles and Scripts on your website; add custom CSS to the first screen and not first screen optionally, choose where to apply. Use it to improve your Core Web Vitals score or just add custom styling. 5 Version: 1.7.0 6 6 Requires at least: 5.8 7 Tested up to: 6. 37 Tested up to: 6.4 8 8 Requires PHP: 7.4 9 9 Author: Vadim Volkov, Firmcatalyst … … 65 65 } 66 66 67 // ++Ctrl + H 68 // ++make the difference between first and second codemirrors more visible 69 // ++highlight the developers mode as it can be the source of rage 70 // ++add those metas to the table too 67 71 // ++first field placeholder make more obvious 68 72 // ++switch selects to checkboxes or multiples -
fcp-first-screen-css/trunk/inc/admin/main.php
r2982085 r3004853 16 16 add_action( 'init', function() { 17 17 $shorter = [ 18 'name' => ' First Screen CSS & Settings',19 'plural' => ' First Screen CSS',18 'name' => 'CSS Settings Set', 19 'plural' => 'CSS Settings', 20 20 'public' => false, 21 21 ]; -
fcp-first-screen-css/trunk/inc/admin/meta-print.php
r2982085 r3004853 91 91 // get post types to print options 92 92 list( 'public' => $public_post_types, 'archive' => $archives_post_types ) = get_all_post_types(); 93 $all_templates = get_all_templates(); 93 94 94 95 ?><p><strong>Apply to the post types:</strong></p><?php … … 108 109 ]); 109 110 110 ?> 111 <p>To apply this CSS Settings to a <strong>specific post</strong>, navigate to the desired post editor and choose this Setting from the dropdown menu located in the right sidebar.</p> 111 if ($all_templates) { 112 ?><p><strong>Apply to the Templates</strong> (doesn't depend on the options above):</p><?php 113 114 checkboxes( (object) [ 115 'name' => 'post-templates', 116 'options' => get_all_templates(), 117 'value' => get_post_meta( $post->ID, FCPFSC_PREF.'post-templates' )[0] ?? '', 118 ]); 119 } 120 121 ?> 122 <p>To apply this CSS Settings to a <strong>specific post</strong>, navigate to the desired post post-editor and choose this Setting from the dropdown menu located in the right sidebar.</p> 112 123 <?php 113 124 … … 191 202 function css_type_meta_tools() { 192 203 ?> 193 <p>The set of CSS Settings above take effect once published and applied to any post, post-type or archi eve of your website. To undo the impact save the post as a draft or delete it.</p>204 <p>The set of CSS Settings above take effect once published and applied to any post, post-type or archive of your website. To undo the impact save the post as a draft or delete it.</p> 194 205 <p>You can <strong>extract the First-screen CSS</strong> of any page using these scripts. The instructions are provided inside.</p> 195 206 <ul> -
fcp-first-screen-css/trunk/inc/admin/meta-save.php
r2973591 r3004853 19 19 20 20 if ( $post->post_type === FCPFSC_SLUG ) { 21 $fields = [ 'post-types', 'post-archives', ' development-mode', 'inline-style-names', 'inline-script-names', 'defer-style-names', 'defer-script-names', 'deregister-style-names', 'deregister-script-names', 'rest-css', 'rest-css-defer' ];21 $fields = [ 'post-types', 'post-archives', 'post-templates', 'development-mode', 'inline-style-names', 'inline-script-names', 'defer-style-names', 'defer-script-names', 'deregister-style-names', 'deregister-script-names', 'rest-css', 'rest-css-defer' ]; 22 22 } else { 23 23 $fields = [ 'id', 'id-exclude' ]; … … 118 118 case ( 'post-archives' ): 119 119 return array_intersect( $value, array_keys( get_all_post_types()['archive'] ) ); 120 break; 121 case ( 'post-templates' ): 122 return array_intersect( $value, array_keys( get_all_templates() ) ); 120 123 break; 121 124 case ( 'development-mode' ): -
fcp-first-screen-css/trunk/inc/apply/main.php
r2973591 r3004853 25 25 26 26 if ( is_singular( $post_type ) ) { 27 27 // get css by post id 28 28 if ( $css_id = get_post_meta( $qo->ID, FCPFSC_PREF.'id' )[0] ?? null ) { 29 29 $csss[] = $css_id; 30 30 } 31 31 32 32 // get css by post-type 33 33 //if ( (int) get_option('page_on_front') !== (int) $qo->ID ) { // exclude the front-page, as they stand out, mostly 34 34 $csss = array_merge( $csss, get_fcpfsc_ids( FCPFSC_PREF.'post-types', $post_type ) ); 35 35 //} 36 36 } 37 38 // get css by archive 37 39 if ( is_home() || is_archive() && ( !$post_type || $post_type === 'page' ) ) { 38 40 // get css for blog … … 44 46 } 45 47 48 // get css by template 49 $template = get_page_template_slug( $qo->ID ); 50 if ( $template ) { // not default '' and not not-applied false 51 $csss = array_merge( $csss, get_fcpfsc_ids( FCPFSC_PREF.'post-templates', $template ) ); 52 } 53 54 55 46 56 if ( empty( $csss ) ) { return; } 47 57 48 // filter by post_status, post_type, development-mode58 // filter by css-post_status, post_type, development-mode 49 59 $csss = filter_csss( $csss ); 50 60 -
fcp-first-screen-css/trunk/inc/functions.php
r2973591 r3004853 32 32 } 33 33 34 function get_all_templates() { 35 return array_flip( \get_page_templates() ); 36 } 37 34 38 function css_minify($css) { 35 39 $preg_replace = function($regexp, $replace, $string) { // avoid null result so that css still works even though not fully minified -
fcp-first-screen-css/trunk/readme.txt
r2985554 r3004853 3 3 Tags: css, first screen, style, web vitals, inline, defer, deregister 4 4 Requires at least: 5.8 5 Tested up to: 6. 35 Tested up to: 6.4 6 6 Requires PHP: 7.4 7 Stable tag: 1. 6.47 Stable tag: 1.7.0 8 8 Author: Vadim Volkov, Firmcatalyst 9 9 Author URI: https://firmcatalyst.com … … 11 11 License URI: http://www.gnu.org/licenses/gpl-3.0.html 12 12 13 First Screen CSS & Settings 13 Manipulate enqueued Styles and Scripts on the website; add custom CSS optionally 14 14 15 15 == Description == 16 16 17 This is a professional tool to manipulate enqueued styles and scripts on your website and add custom CSS to first screen and not first screen optionally. Use it to improve your Core Web Vitals score or just add custom styling.17 This is a professional tool to manipulate enqueued Styles and Scripts on your website; add custom CSS to the first screen and not first screen optionally, choose where to apply. Use it to improve your Core Web Vitals score or just add custom styling. 18 18 19 19 = Features = … … 23 23 * Apply changes to all posts of a specific type 24 24 * Apply changes to the blog or any post-type archive 25 * Inline, defer, or de-register Styles or JS25 * Inline, defer, or de-register / disable Styles and Scripts 26 26 * Edit CSS easily with the CodeMirror visual editor 27 27 * Automatic CSS minification 28 * Instructions to get CSS 28 29 29 30 = Demo = … … 34 35 35 36 * Install and activate the plugin. 36 * Navigate to " First Screen CSS" in the left sidebar of your wp-admin.37 * Click "Add New ."37 * Navigate to "CSS Settings" in the left sidebar of your wp-admin. 38 * Click "Add New" Settincs Set 38 39 * Input your CSS or adjust the settings. 39 * Choose where to apply the changes and publish. 40 * Choose where to apply the changes and Publish. 41 * Repeat to apply a different set of settings to other posts. 40 42 41 43 == Installation == … … 53 55 54 56 == Upgrade Notice == 57 58 = 1.7 = 59 60 * Added the option to apply Settings by Template 61 * Added useful functions to CodeMirror editor 55 62 56 63 = 1.6 =
Note: See TracChangeset
for help on using the changeset viewer.