94% wp-defer-loading

Code Review | WP Defer Loading

WordPress plugin WP Defer Loading scored 94% from 53 tests.

About plugin

  • Plugin page: wp-defer-loading
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.7.1
  • WordPress version: 5.8.1
  • First release: Oct 23, 2013
  • Latest release: Nov 9, 2013
  • Number of updates: 10
  • Update frequency: every 1.7 days
  • Top authors: bassjobsen (100%)

Code review

53 tests

User reviews

5 reviews

Install metrics

20+ active / 8,306 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼265.47ms] Passed 4 tests

Analyzing server-side resources used by WP Defer Loading
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0343.25 ▲8.54
Dashboard /wp-admin3.08 ▲0.0342.07 ▲1.28
Posts /wp-admin/edit.php3.13 ▲0.0240.93 ▼4.83
Add New Post /wp-admin/post-new.php5.44 ▲0.0191.56 ▼1,053.32
Media Library /wp-admin/upload.php3.02 ▲0.0130.75 ▼5.02

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WP Defer Loading: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,635 ▲5315.89 ▲0.388.35 ▲0.1257.28 ▲11.99
Dashboard /wp-admin2,930 ▲775.97 ▲0.09137.63 ▲8.93107.23 ▲9.91
Posts /wp-admin/edit.php2,706 ▼02.68 ▼0.0167.02 ▼4.8089.30 ▲3.33
Add New Post /wp-admin/post-new.php1,653 ▼20018.76 ▼0.07374.94 ▼15.22108.22 ▲0.74
Media Library /wp-admin/upload.php1,775 ▼05.00 ▲0.02167.12 ▲6.36108.04 ▼12.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Scripts' not found in wp-content/plugins/wp-defer-loading/wp-defer-loading.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (performance) image not found
You can take inspiration from this readme.txt

wp-defer-loading/wp-defer-loading.php Passed 13 tests

The main PHP file in "WP Defer Loading" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
109 characters long description:
Defer loading javascript for WordPress. Without any additional library. Just the way Google ask you to do it.

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
Good job! No executable or dangerous file extensions detected1,279 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity13.00
▷ Minimum class complexity5.00
▷ Maximum class complexity21.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods225.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings