94% ad-refresh-control

Code Review | Ad Refresh Control

WordPress plugin Ad Refresh Control scored 94% from 54 tests.

About plugin

  • Plugin page: ad-refresh-control
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7
  • WordPress version: 5.9.2
  • First release: Oct 1, 2020
  • Latest release: Jun 23, 2021
  • Number of updates: 6
  • Update frequency: every 46.3 days
  • Top authors: 10upbot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 11,209 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼294.17ms] Passed 4 tests

Server-side resources used by Ad Refresh Control
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2152.47 ▲0.04
Dashboard /wp-admin3.57 ▲0.1634.81 ▲0.66
Posts /wp-admin/edit.php3.80 ▲0.1537.66 ▼3.70
Add New Post /wp-admin/post-new.php7.04 ▲0.0693.53 ▼1,172.27
Media Library /wp-admin/upload.php3.45 ▲0.1525.33 ▼0.75
Ad Refresh Control /wp-admin/options-general.php?page=ad-refresh-control-settings3.4224.45

Server storage [IO: ▲0.08MB] [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: 28 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ad Refresh Control
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,775 ▲5316.19 ▲0.537.95 ▲2.192.62 ▲0.36
Dashboard /wp-admin2,897 ▲366.09 ▼0.07118.35 ▼15.20158.61 ▼6.24
Posts /wp-admin/edit.php2,690 ▲53.24 ▲0.0164.85 ▲1.67140.52 ▲2.07
Add New Post /wp-admin/post-new.php1,664 ▼8817.57 ▼4.09429.56 ▼32.38162.35 ▲4.91
Media Library /wp-admin/upload.php1,703 ▲55.52 ▲0.02148.56 ▼9.19185.48 ▼17.71
Ad Refresh Control /wp-admin/options-general.php?page=ad-refresh-control-settings1,1442.3854.99116.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ad-refresh-control/ad-refresh-control.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: google, ad manager

ad-refresh-control/ad-refresh-control.php 92% from 13 tests

This is the main PHP file of "Ad Refresh Control" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
Good job! No executable or dangerous file extensions detected1,117 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP13219478928
JavaScript33556167
CSS9112617
JSON1005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity24.25
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods40
▷ Static methods1845.00%
▷ Public methods3895.00%
▷ Protected methods00.00%
▷ Private methods25.00%
Functions31
▷ Named functions2374.19%
▷ Anonymous functions825.81%
Constants4
▷ Global constants4100.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
No PNG files were detected