84% simple-dns-prefetch

Code Review | Simple DNS Prefetch

WordPress plugin Simple DNS Prefetch scored84%from 54 tests.

About plugin

  • Plugin page: simple-dns-prefetch
  • Plugin version: 0.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.9.6
  • WordPress version: 6.3.1
  • First release: Sep 9, 2017
  • Latest release: Jun 8, 2018
  • Number of updates: 7
  • Update frequency: every 39.0 days
  • Top authors: andrewmoof (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /4,044 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.98ms] Passed 4 tests

Server-side resources used by Simple DNS Prefetch
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.28 ▼3.40
Dashboard /wp-admin3.34 ▲0.0449.62 ▼0.54
Posts /wp-admin/edit.php3.39 ▲0.0447.89 ▼1.24
Add New Post /wp-admin/post-new.php5.92 ▲0.0494.22 ▼5.88
Media Library /wp-admin/upload.php3.27 ▲0.0434.36 ▼1.41
Simple DNS Prefetch /wp-admin/options-general.php?page=menu_simplednsprefetch3.2335.15

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
sdp_prefetch_host_list
sdp_meta_control
widget_recent-comments
can_compress_scripts
db_upgraded
sdp_is_dns_disable
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Simple DNS Prefetch
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.69 ▲0.341.84 ▲0.1241.54 ▼0.86
Dashboard /wp-admin2,202 ▲255.65 ▲0.1190.81 ▼1.9541.82 ▲0.33
Posts /wp-admin/edit.php2,101 ▲11.96 ▼0.1639.37 ▼0.5334.55 ▼4.04
Add New Post /wp-admin/post-new.php1,531 ▲523.20 ▲0.01636.70 ▼49.8156.12 ▼1.76
Media Library /wp-admin/upload.php1,404 ▲44.19 ▼0.0599.10 ▼17.8246.60 ▼2.67
Simple DNS Prefetch /wp-admin/options-general.php?page=menu_simplednsprefetch8712.1724.7928.09

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 9 options
    • sdp_is_dns_disable
    • widget_theysaidso_widget
    • db_upgraded
    • sdp_prefetch_host_list
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • sdp_meta_control

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-dns-prefetch/simple-dns-prefetch.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: speed, prefetch, dns-prefetch, optimization, dns

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

The principal PHP file in "Simple DNS Prefetch" v. 0.5.2 is loaded by WordPress automatically on each request
47 characters long description:
This plugin controls the DNS prefetch settings.

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
Everything looks great! No dangerous files found in this plugin149 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24223149

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin