77% ad-manage

Code Review | Advert Manage

WordPress plugin Advert Manage scored 77% 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: 5.9.2
  • 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 / 554 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.18MB] [CPU: ▼321.42ms] Passed 4 tests

Analyzing server-side resources used by Advert Manage
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1079.83 ▲31.05
Dashboard /wp-admin3.58 ▲0.1739.05 ▼30.29
Posts /wp-admin/edit.php3.80 ▲0.1643.01 ▲4.84
Add New Post /wp-admin/post-new.php5.83 ▼1.13109.21 ▼1,265.09
Media Library /wp-admin/upload.php3.51 ▲0.2232.07 ▲4.87
/wp-admin/admin.php?page=am-location3.4125.38
Locations /wp-admin/admin.php?page=am-locations3.4350.58
Settings /wp-admin/admin.php?page=am-settings3.4324.50
Adverts /wp-admin/admin.php?page=ad-manager3.4325.87
New Advert /wp-admin/admin.php?page=am-advert3.5225.98

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 68 new files
Database: 1 new table, 4 new options
New tables
wp_admg_adverts
New WordPress options
admg_content_permission
admg_intra_post_min_length
admg_settings_permission
widget_admg_location_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Advert Manage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,908 ▲15415.91 ▲0.256.40 ▼0.2236.45 ▲33.48
Dashboard /wp-admin2,918 ▲576.12 ▼0.03120.76 ▼21.59149.99 ▼17.08
Posts /wp-admin/edit.php2,731 ▲613.24 ▼0.0164.93 ▼15.28141.36 ▼28.44
Add New Post /wp-admin/post-new.php1,807 ▲17224.74 ▲6.20327.53 ▼133.43200.18 ▲37.26
Media Library /wp-admin/upload.php1,739 ▲415.51 ▼0.01145.99 ▼2.12193.83 ▼2.81
/wp-admin/admin.php?page=am-location1,1182.5055.6588.41
Locations /wp-admin/admin.php?page=am-locations1,1412.7353.98127.16
Settings /wp-admin/admin.php?page=am-settings1,1712.4855.91185.43
Adverts /wp-admin/admin.php?page=ad-manager1,1472.6861.04142.92
New Advert /wp-admin/admin.php?page=am-advert1,7334.6974.56199.10

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_admg_location_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 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
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 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
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === ad-manage === )
  • Screenshots: Add images for these screenshots: #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 might help

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

The entry point to "Advert Manage" version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 165 characters long)
  • Main file name: Name the main plugin file the same 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 a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin2,986 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP276691712,107
JavaScript812740361
Sass8521314
CSS250204

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
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
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1773.91%
▷ Protected methods00.00%
▷ Private methods626.09%
Functions113
▷ Named functions7162.83%
▷ Anonymous functions4237.17%
Constants1
▷ 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-2.png35.60KB9.96KB▼ 72.04%
assets/screenshot-3.png36.86KB10.89KB▼ 70.45%
assets/screenshot-1.png147.02KB39.33KB▼ 73.25%
assets/screenshot-4.png43.39KB12.42KB▼ 71.39%