90% pre-party-browser-hints

Code Review | Pre* Party Resource Hints

WordPress plugin Pre* Party Resource Hints scored90%from 54 tests.

About plugin

  • Plugin page: pre-party-browser...
  • Plugin version: 1.8.18
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 3, 2016
  • Latest release: Nov 12, 2023
  • Number of updates: 147
  • Update frequency: every 17.5 days
  • Top authors: samperrow (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

7,000+ active /149,269 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.53MB] [CPU: ▼1.83ms] Passed 4 tests

Server-side resources used by Pre* Party Resource Hints
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3136.11 ▼5.60
Dashboard /wp-admin3.91 ▲0.6050.52 ▲4.18
Posts /wp-admin/edit.php3.96 ▲0.6050.82 ▼1.29
Add New Post /wp-admin/post-new.php6.49 ▲0.6095.99 ▼4.62
Media Library /wp-admin/upload.php3.83 ▲0.6038.56 ▲5.29

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 49 new files
Database: 1 new table, 18 new options
New tables
wp_pprh_table
New WordPress options
theysaidso_admin_options
pprh_prefetch_disableForLoggedInUsers
can_compress_scripts
widget_theysaidso_widget
pprh_disable_wp_hints
widget_recent-comments
pprh_preconnect_allow_unauth
pprh_prefetch_ignoreKeywords
pprh_preconnect_set
pprh_prefetch_max_prefetches
...

Browser metrics Passed 4 tests

Checking browser requirements for Pre* Party Resource Hints
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲4814.72 ▲0.332.02 ▲0.0141.52 ▼1.89
Dashboard /wp-admin2,195 ▲185.50 ▼0.0788.71 ▼11.9785.93 ▲40.01
Posts /wp-admin/edit.php2,115 ▲151.98 ▲0.0339.89 ▼1.2438.07 ▲1.23
Add New Post /wp-admin/post-new.php1,554 ▲2823.23 ▲0.04669.21 ▲40.4054.45 ▼2.60
Media Library /wp-admin/upload.php1,415 ▲214.17 ▼0.0799.93 ▼1.0974.48 ▲28.72

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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 is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: Please take inspiration from this readme.txt

pre-party-browser-hints/pre-party-browser-hints.php Passed 13 tests

Analyzing the main PHP file in "Pre* Party Resource Hints" version 1.8.18
130 characters long description:
Take advantage of the browser resource hints DNS-Prefetch, Prerender, Preconnect, Prefetch, and Preload to improve page load time.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin4,469 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP237365772,994
PO File2132137691
JavaScript414340599
Sass1380184
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity16.14
▷ Minimum class complexity2.00
▷ Maximum class complexity132.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods219
▷ Static methods4420.09%
▷ Public methods16173.52%
▷ Protected methods2611.87%
▷ Private methods3214.61%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants12
▷ Global constants12100.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
5 PNG files occupy 0.12MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/preload.png22.92KB10.38KB▼ 54.73%
images/prerender.png7.78KB4.61KB▼ 40.70%
images/lightning.png0.62KB0.56KB▼ 10.17%
images/dns-prefetch.png49.11KB11.92KB▼ 75.72%
images/preconnect.png44.57KB11.69KB▼ 73.77%