78% wp-dynamic-ads

Code Review | WP Dynamic Ads

WordPress plugin WP Dynamic Ads scored78%from 54 tests.

About plugin

  • Plugin page: wp-dynamic-ads
  • Plugin version: 0.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.5
  • WordPress version: 6.3.1
  • First release: Nov 4, 2020
  • Latest release: Dec 1, 2020
  • Number of updates: 6
  • Update frequency: every 4.5 days
  • Top authors: saschahuber (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /375 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.24ms] Passed 4 tests

This is a short check of server-side resources used by WP Dynamic Ads
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.42 ▲4.48
Dashboard /wp-admin3.31 ▲0.0050.48 ▼4.56
Posts /wp-admin/edit.php3.36 ▲0.0054.50 ▲1.81
Add New Post /wp-admin/post-new.php5.89 ▲0.00103.42 ▲0.01
Media Library /wp-admin/upload.php3.23 ▲0.0038.02 ▲1.78

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

WP Dynamic Ads: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲3213.63 ▼0.751.59 ▼0.4839.88 ▼5.73
Dashboard /wp-admin2,207 ▲165.91 ▲0.09109.69 ▲6.7844.09 ▲0.39
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0142.13 ▼2.1435.84 ▼4.22
Add New Post /wp-admin/post-new.php1,534 ▲1522.33 ▼0.86597.61 ▼70.1155.19 ▼8.50
Media Library /wp-admin/upload.php1,389 ▲14.20 ▼0.00104.13 ▼5.3039.64 ▼7.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-dynamic-ads/index.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-dynamic-ads/class/AdShortcodeRegisterHook.php:9
    • > PHP Parse error
      syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) or const (T_CONST) in wp-content/plugins/wp-dynamic-ads/class/Settings.php on line 76
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-dynamic-ads/class/MetaBoxPostListRegisterHook.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'WPDA_MetaBoxRegisterHook' not found in wp-content/plugins/wp-dynamic-ads/class/AdPostTypeRegisterHook.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
2 plugin tags: ad-placement, ads

wp-dynamic-ads/index.php 92% from 13 tests

"WP Dynamic Ads" version 0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-dynamic-ads.php" instead of "index.php")

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 plugin337 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP77841295
PO File115042

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity6.17
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods1894.74%
▷ Protected methods00.00%
▷ Private methods15.26%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected