83% auto-prefetch-url-in-viewport

Code Review | Auto Prefetch URL in Viewport

WordPress plugin Auto Prefetch URL in Viewport scored83%from 54 tests.

About plugin

  • Plugin page: auto-prefetch-url...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6 or later+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 6.3.1
  • First release: Feb 4, 2022
  • Latest release: Feb 4, 2022
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: wongsiongkiat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /663 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
This plugin's installer ran successfully

Server metrics [RAM: ▼1.04MB] [CPU: ▼38.75ms] Passed 4 tests

A check of server-side resources used by Auto Prefetch URL in Viewport
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0146.48 ▲6.43
Dashboard /wp-admin2.90 ▼0.4114.72 ▼36.86
Posts /wp-admin/edit.php2.90 ▼0.4617.40 ▼29.06
Add New Post /wp-admin/post-new.php2.90 ▼2.9915.09 ▼71.10
Media Library /wp-admin/upload.php2.90 ▼0.3315.69 ▼17.96

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
category_children
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Auto Prefetch URL in Viewport: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲8613.57 ▼0.8112.31 ▲10.5042.86 ▼0.98
Dashboard /wp-admin240 ▼1,9488.14 ▲3.2474.17 ▼44.3916.58 ▼30.85
Posts /wp-admin/edit.php240 ▼1,8498.13 ▲6.1259.35 ▲22.5016.23 ▼20.10
Add New Post /wp-admin/post-new.php240 ▼1,2818.14 ▼14.9665.10 ▼617.4316.59 ▼42.97
Media Library /wp-admin/upload.php240 ▼1,1517.98 ▲3.7462.75 ▼43.4317.91 ▼25.63

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • category_children
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/auto-prefetch-url-in-viewport/auto-prefetch-url-in-viewport.php

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Requires php: Invalid version format
Please take inspiration from this readme.txt

auto-prefetch-url-in-viewport/auto-prefetch-url-in-viewport.php 85% from 13 tests

The main PHP script in "Auto Prefetch URL in Viewport" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Requires PHP: Please use periods and digits for the required version (ex. "7.0" instead of "5.6 or later")
  • Description: The description should be shorter than 140 characters (currently 198 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin11 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP151910
JavaScript1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.50
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 files were detected