78% wp-scheduled-styles

Code Review | WP Scheduled Styles

WordPress plugin WP Scheduled Styles scored78%from 54 tests.

About plugin

  • Plugin page: wp-scheduled-styles
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.0.1
  • WordPress version: 6.3.1
  • First release: Aug 15, 2011
  • Latest release: Dec 11, 2014
  • Number of updates: 26
  • Update frequency: every 51.8 days
  • Top authors: wpgwiggum (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,016 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.79ms] Passed 4 tests

A check of server-side resources used by WP Scheduled Styles
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0343.27 ▲1.43
Dashboard /wp-admin3.34 ▲0.0349.07 ▼0.21
Posts /wp-admin/edit.php3.39 ▲0.0352.83 ▲5.25
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.85 ▼5.04
Media Library /wp-admin/upload.php3.26 ▲0.0335.62 ▲0.64

Server storage [IO: ▲0.10MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 23 new files
Database: 1 new table, 7 new options
New tables
wp_scheduledstyles
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
scheduledstyles_db_version

Browser metrics Passed 4 tests

WP Scheduled Styles: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.15 ▼1.531.75 ▼0.0043.39 ▲4.10
Dashboard /wp-admin2,210 ▲225.81 ▲0.81100.88 ▼19.7038.44 ▼6.79
Posts /wp-admin/edit.php2,090 ▲42.06 ▲0.0635.15 ▲2.7130.96 ▼2.00
Add New Post /wp-admin/post-new.php1,536 ▲1723.17 ▲0.09664.50 ▲1.1855.74 ▲7.52
Media Library /wp-admin/upload.php1,392 ▲14.20 ▲0.0193.71 ▼7.2241.70 ▼1.09
Scheduled Styles /wp-admin/scheduledStyles.php260.440.1112.66

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • scheduledstyles_db_version
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-scheduled-styles/scheduledStyles.php:40
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-scheduled-styles/scheduledStyles.php on line 40
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-scheduled-styles/adminPage.php:8
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-scheduled-styles/uninstall.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/wp-scheduled-styles/uninstall.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/scheduledStyles.php
    • > Network (severe)
    wp-admin/scheduledStyles.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: plugin, scheduled, cron, style, cronjob...

wp-scheduled-styles/scheduledStyles.php 92% from 13 tests

The main PHP file in "WP Scheduled Styles" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-scheduled-styles.php" instead of "scheduledStyles.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin587 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS23260326
PHP33068232
JavaScript271429

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-icons_f9bd01_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png3.38KB1.68KB▼ 50.10%
css/images/ui-icons_217bc0_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png0.10KB0.13KB0.00%