87% preloader-sws

Code Review | Preloader by WordPress Monsters

WordPress plugin Preloader by WordPress Monsters scored 87% from 54 tests.

About plugin

  • Plugin page: preloader-sws
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-4.7.2
  • WordPress version: 5.8.1
  • First release: Mar 9, 2016
  • Latest release: Nov 15, 2016
  • Number of updates: 31
  • Update frequency: every 15.7 days
  • Top authors: AlexSpace (70.97%)Wordpress Monsters (29.03%)Otto42 (6.45%)

Code review

54 tests

User reviews

25 reviews

Install metrics

700+ active / 9,680 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼140.37ms] Passed 4 tests

This is a short check of server-side resources used by Preloader by WordPress Monsters
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2039.51 ▲15.82
Dashboard /wp-admin3.14 ▲0.0934.50 ▼14.22
Posts /wp-admin/edit.php3.23 ▲0.1247.98 ▲2.12
Add New Post /wp-admin/post-new.php5.51 ▲0.0897.31 ▼553.65
Media Library /wp-admin/upload.php3.08 ▲0.0838.31 ▲4.27
Preloader /wp-admin/options-general.php?page=sws-preloader-options3.0631.06

Server storage [IO: ▲27.10MB] [DB: ▲0.62MB] 67% from 3 tests

Filesystem and database footprint
Please try to fix the following items
  • Try to limit filesystem usage to 25MB (currently using 27.10MB)
Filesystem: 135 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Preloader by WordPress Monsters
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,842 ▲24716.66 ▲1.2315.17 ▲6.0550.89 ▲2.76
Dashboard /wp-admin3,001 ▲707.20 ▲1.26171.97 ▲31.72115.01 ▲2.24
Posts /wp-admin/edit.php2,770 ▲312.70 ▲0.0179.27 ▲13.49109.89 ▲15.63
Add New Post /wp-admin/post-new.php1,702 ▲8719.13 ▼2.86380.51 ▲78.58137.07 ▲25.34
Media Library /wp-admin/upload.php1,839 ▲325.53 ▲0.53128.89 ▼26.94126.41 ▼3.27
Preloader /wp-admin/options-general.php?page=sws-preloader-options1,7082.8568.9899.19

Uninstaller [IO: ▲0.00MB] [DB: ▲0.62MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 91 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sws-preloader-options
    • > Notice in wp-content/plugins/preloader-sws/includes/sws-preloader-settings.php+90
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/preloader-sws/preloader-by-sws.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/preloader-sws/includes/view.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sws_set_selected() in wp-content/plugins/preloader-sws/includes/preloaders/light.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sws_set_selected() in wp-content/plugins/preloader-sws/includes/preloaders/dark.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/preloader-sws/includes/sws-preloader-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/preloader-sws/uninstall.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/preloader-sws/includes/admin_assets.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sws_set_selected() in wp-content/plugins/preloader-sws/includes/preloaders/juicy.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sws_set_selected() in wp-content/plugins/preloader-sws/includes/preloaders/no-bg.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/preloader-sws/includes/frontend-assets.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (List of preloaders - "With background".), #2 (List of preloaders - "Without background".), #3 (You can upload your own preloader.)
The official readme.txt might help

preloader-sws/preloader-by-sws.php 85% from 13 tests

"Preloader by WordPress Monsters" version 1.2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 144 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("preloader-sws.php" instead of "preloader-by-sws.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected875 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP1011440636
CSS3393162
JavaScript3111477

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin