77% ad-manage

Code Review | Advert Manage

WordPress plugin Advert Manage scored77%from 54 tests.

About plugin

  • Plugin page: ad-manage
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Feb 9, 2017
  • Latest release: Feb 10, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: bananaboat30p (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /719 total downloads


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.17MB] [CPU: ▼19.53ms] Passed 4 tests

This is a short check of server-side resources used by Advert Manage
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1336.23 ▼0.99
Dashboard /wp-admin3.53 ▲0.1846.52 ▼13.65
Posts /wp-admin/edit.php3.58 ▲0.2245.23 ▼2.82
Add New Post /wp-admin/post-new.php4.76 ▼1.1344.50 ▼60.64
Media Library /wp-admin/upload.php3.39 ▲0.1642.32 ▲6.60
New Advert /wp-admin/admin.php?page=am-advert3.3935.07
Adverts /wp-admin/admin.php?page=ad-manager3.3732.34
Locations /wp-admin/admin.php?page=am-locations3.3632.24
Settings /wp-admin/admin.php?page=am-settings3.3628.86

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 68 new files
Database: 1 new table, 10 new options
New tables
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advert Manage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲11414.38 ▲0.021.71 ▲0.1152.76 ▲12.44
Dashboard /wp-admin2,226 ▲525.50 ▼0.0381.64 ▼4.7339.54 ▼4.76
Posts /wp-admin/edit.php2,128 ▲281.96 ▼0.0634.36 ▼6.8034.89 ▼0.03
Add New Post /wp-admin/post-new.php1,618 ▲9225.11 ▲1.64512.61 ▼170.5665.50 ▲15.86
Media Library /wp-admin/upload.php1,434 ▲344.27 ▼0.01103.50 ▼1.7846.63 ▼1.37
New Advert /wp-admin/admin.php?page=am-advert1,2803.1144.2932.23
Adverts /wp-admin/admin.php?page=ad-manager8942.0725.6226.78
Locations /wp-admin/admin.php?page=am-locations9072.0323.0229.02
Settings /wp-admin/admin.php?page=am-settings9062.0623.3324.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • widget_admg_location_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=am-advert
    • > Notice in wp-content/plugins/ad-manage/admin/advert/advert.php+74
    Undefined index: action

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ad-manage/admin/settings/settings.php:25

User-side errors Passed 1 test

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


Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === ad-manage === )
  • Screenshots: These screenshots do not have images: #1 (Creating an advert), #2 (All adverts are displayed in an easy to see list, just like posts), #3 (Set rules to determine whether your ad will be shown. Schedule it, limit it to a specific post / category), #4 (Choose where your post should be shown. Before the content, in the sidebar, etc)
The official readme.txt is a good inspiration

ad-manage/ad-manager.php 85% from 13 tests

The primary PHP file in "Advert Manage" version 1.0.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 165 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ad-manage.php" instead of "ad-manager.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected2,986 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.00
▷ Minimum class complexity4.00
▷ Maximum class complexity9.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods1773.91%
▷ Protected methods00.00%
▷ Private methods626.09%
▷ Named functions7162.83%
▷ Anonymous functions4237.17%
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.26MB with 0.18MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png36.86KB10.89KB▼ 70.45%
assets/screenshot-4.png43.39KB12.42KB▼ 71.39%
assets/screenshot-2.png35.60KB9.96KB▼ 72.04%
assets/screenshot-1.png147.02KB39.33KB▼ 73.25%