90% asset-preloader

Code Review | Asset Preloader: preload the assets only on the pages where you need it

WordPress plugin Asset Preloader: preload the assets only on the pages where you need it scored90%from 54 tests.

About plugin

  • Plugin page: asset-preloader
  • Plugin version: 0.0.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Oct 14, 2022
  • Latest release: Nov 1, 2023
  • Number of updates: 20
  • Update frequency: every 19.2 days
  • Top authors: giuse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /911 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Asset Preloader: preload the assets only on the pages where you need it
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.52 ▼1.78
Dashboard /wp-admin3.35 ▼0.0045.76 ▼12.50
Posts /wp-admin/edit.php3.40 ▲0.0448.97 ▲0.68
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.81 ▲2.71
Media Library /wp-admin/upload.php3.27 ▲0.0435.95 ▼0.28

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Asset Preloader: preload the assets only on the pages where you need it
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲3014.34 ▼0.241.56 ▼0.1437.05 ▼2.44
Dashboard /wp-admin2,207 ▲325.59 ▼0.0190.77 ▼14.7441.96 ▲3.06
Posts /wp-admin/edit.php2,115 ▲151.98 ▼0.0138.63 ▲2.7936.15 ▲1.80
Add New Post /wp-admin/post-new.php6,244 ▲4,71825.99 ▲2.92837.81 ▲127.1052.67 ▼6.56
Media Library /wp-admin/upload.php1,415 ▲124.18 ▼0.1399.85 ▲4.7940.90 ▼4.99

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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 on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: performance, rendering, http requests order, speed optimization

asset-preloader/asset-preloader.php 92% from 13 tests

The principal PHP file in "Asset Preloader: preload the assets only on the pages where you need it" v. 0.0.6 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected202 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP51327202

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.59
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%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin