84% dns-prefetch

Code Review | DNS Prefetch

WordPress plugin DNS Prefetch scored84%from 54 tests.

About plugin

  • Plugin page: dns-prefetch
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1
  • WordPress version: 6.3.1
  • First release: Apr 19, 2014
  • Latest release: Jan 20, 2015
  • Number of updates: 13
  • Update frequency: every 21.2 days
  • Top authors: jp2112 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /3,026 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.65ms] Passed 4 tests

A check of server-side resources used by DNS Prefetch
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.09 ▲1.49
Dashboard /wp-admin3.37 ▲0.0647.03 ▼2.01
Posts /wp-admin/edit.php3.48 ▲0.1247.45 ▼1.47
Add New Post /wp-admin/post-new.php5.95 ▲0.0680.95 ▼20.61
Media Library /wp-admin/upload.php3.29 ▲0.0634.21 ▲3.63
DNS Prefetch /wp-admin/options-general.php?page=dns-prefetch3.2629.54

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

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

Browser metrics Passed 4 tests

A check of browser resources used by DNS Prefetch
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7414.03 ▼0.322.12 ▲0.6444.01 ▲5.29
Dashboard /wp-admin2,202 ▲225.62 ▼0.0490.06 ▼3.1739.18 ▼8.80
Posts /wp-admin/edit.php2,104 ▲41.96 ▼0.0638.92 ▲1.8536.53 ▲1.69
Add New Post /wp-admin/post-new.php1,529 ▲323.02 ▲0.13683.36 ▲10.8558.55 ▲3.36
Media Library /wp-admin/upload.php1,398 ▼24.25 ▲0.0393.71 ▼1.8442.19 ▼4.23
DNS Prefetch /wp-admin/options-general.php?page=dns-prefetch8782.3022.8242.07

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/dns-prefetch/dns-prefetch.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
3 plugin tags: prefetch, optimization, dns

dns-prefetch/dns-prefetch.php Passed 13 tests

"DNS Prefetch" version 0.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
43 characters long description:
Add DNS prefetching meta tags to your site.

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
There were no executable files found in this plugin227 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP31437222
CSS1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/globe.png8.54KB3.77KB▼ 55.85%
images/settings.png2.11KB2.31KB0.00%
images/support.png5.03KB2.79KB▼ 44.54%