84% managead

Code Review | ManageAd

WordPress plugin ManageAd scored84%from 54 tests.

About plugin

  • Plugin page: managead
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 28, 2020
  • Latest release: Jul 7, 2020
  • Number of updates: 4
  • Update frequency: every 2.8 days
  • Top authors: cagdasdag (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /542 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▲0.59ms] Passed 4 tests

A check of server-side resources used by ManageAd
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0742.27 ▼6.55
Dashboard /wp-admin3.37 ▲0.0749.16 ▼2.48
Posts /wp-admin/edit.php3.49 ▲0.1355.40 ▲7.63
Add New Post /wp-admin/post-new.php5.97 ▲0.0893.18 ▲3.77
Media Library /wp-admin/upload.php3.30 ▲0.0748.96 ▲11.07
ManageAd /wp-admin/options-general.php?page=managead3.2840.83

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
managead_block_option
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
managead_block_count

Browser metrics Passed 4 tests

An overview of browser requirements for ManageAd
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7513.33 ▼0.901.84 ▼0.9442.92 ▼4.59
Dashboard /wp-admin2,227 ▲394.87 ▼0.94106.93 ▲5.0042.27 ▲3.89
Posts /wp-admin/edit.php2,110 ▲212.02 ▲0.0340.65 ▲4.0734.41 ▼0.16
Add New Post /wp-admin/post-new.php1,696 ▲18221.96 ▲4.30668.64 ▼29.9937.23 ▼26.14
Media Library /wp-admin/upload.php1,403 ▲154.20 ▼0.0296.25 ▼13.1843.98 ▼3.18
ManageAd /wp-admin/options-general.php?page=managead8422.0627.7239.07

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 detected upon uninstall: 7 options
    • theysaidso_admin_options
    • managead_block_count
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/managead/admin/partials/view.php:9
    • > PHP Notice
      Undefined variable: heading in wp-content/plugins/managead/admin/partials/view.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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
6 plugin tags: manage ad, gutenberg, ad manager, adsense, gutenberg adsense...

managead/managead.php 92% from 13 tests

This is the main PHP file of "ManageAd" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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
Good job! No executable or dangerous file extensions detected618 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP960126315
JavaScript31829158
CSS1249145

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.60
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.36
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods22
▷ Static methods29.09%
▷ Public methods1881.82%
▷ Protected methods00.00%
▷ Private methods418.18%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin