84% preload-requests

Code Review | Preload Requests

WordPress plugin Preload Requests scored84%from 54 tests.

About plugin

  • Plugin page: preload-requests
  • Plugin version: 1.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 17, 2021
  • Latest release: Sep 13, 2023
  • Number of updates: 11
  • Update frequency: every 68.8 days
  • Top authors: rajkakadiya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,352 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
Install script ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼6.13ms] Passed 4 tests

This is a short check of server-side resources used by Preload Requests
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1935.79 ▼1.37
Dashboard /wp-admin3.51 ▲0.2045.91 ▼5.23
Posts /wp-admin/edit.php3.62 ▲0.2749.61 ▲6.92
Add New Post /wp-admin/post-new.php6.09 ▲0.2081.88 ▼11.12
Media Library /wp-admin/upload.php3.43 ▲0.2035.58 ▼6.80

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Preload Requests
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7213.21 ▼1.541.65 ▼0.1737.30 ▼4.88
Dashboard /wp-admin2,221 ▲304.88 ▼0.01113.51 ▲10.5044.23 ▲1.98
Posts /wp-admin/edit.php2,104 ▲122.01 ▲0.0437.40 ▼0.8834.26 ▲0.15
Add New Post /wp-admin/post-new.php1,543 ▲2923.12 ▲5.47648.35 ▼21.6355.77 ▲2.98
Media Library /wp-admin/upload.php1,403 ▲154.18 ▲0.0693.21 ▼26.5740.00 ▼5.98

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

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)
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 take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/preload-requests/admin/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/preload-requests/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/preload-requests/admin/metabox.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #8 (Preload link options for single Post)
The official readme.txt is a good inspiration

preload-requests/preload-requests.php Passed 13 tests

The main file in "Preload Requests" v. 1.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
136 characters long description:
Plugin Provide you to Add preload links to your website easily, compatible with all major browsers. It will improve your site SEO score.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin744 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP47717723
CSS15021

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.73
Average class complexity67.67
▷ Minimum class complexity44.00
▷ Maximum class complexity102.00
Average method complexity9.70
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin