84% image-preloading

Code Review | Image Preloading

WordPress plugin Image Preloading scored84%from 54 tests.

About plugin

  • Plugin page: image-preloading
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 29, 2017
  • Latest release: Jun 29, 2017
  • Number of updates: 7
  • Update frequency: every 7.1 days
  • Top authors: snowbedding (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /1,756 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.78ms] Passed 4 tests

Analyzing server-side resources used by Image Preloading
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.35 ▼0.25
Dashboard /wp-admin3.32 ▲0.0248.33 ▼1.39
Posts /wp-admin/edit.php3.37 ▲0.0146.01 ▼0.24
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.31 ▼5.22
Media Library /wp-admin/upload.php3.24 ▲0.0134.20 ▲2.41
Image Preloading /wp-admin/options-general.php?page=image-preloading3.2129.69

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Image Preloading
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲7813.18 ▼1.422.03 ▲0.1240.96 ▲0.06
Dashboard /wp-admin2,210 ▲194.82 ▼0.06101.91 ▼1.8140.87 ▲1.02
Posts /wp-admin/edit.php2,093 ▲41.98 ▼0.0835.91 ▼7.2133.54 ▼5.99
Add New Post /wp-admin/post-new.php1,536 ▲2223.45 ▲5.93598.66 ▼21.4654.55 ▼5.10
Media Library /wp-admin/upload.php1,395 ▲74.21 ▲0.02105.06 ▲6.8242.92 ▼2.04
Image Preloading /wp-admin/options-general.php?page=image-preloading8012.0323.3127.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-preloading/index.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
These attributes need your attention: You can look at the official readme.txt

image-preloading/index.php 92% from 13 tests

The principal PHP file in "Image Preloading" v. 1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("image-preloading.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin115 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12017115

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.29
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin