68% ads-management

Code Review | Ads Management

WordPress plugin Ads Management scored 68% from 54 tests.

About plugin

  • Plugin page: ads-management
  • Plugin version: 0.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.2.2
  • WordPress version: 5.9.2
  • First release: Mar 13, 2015
  • Latest release: May 14, 2015
  • Number of updates: 9
  • Update frequency: every 6.9 days
  • Top authors: shahalom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 2,256 total downloads


Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.23MB] [CPU: ▼304.82ms] Passed 4 tests

Server-side resources used by Ads Management
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.2854.99 ▲4.30
Dashboard /wp-admin3.64 ▲0.2334.33 ▼4.87
Posts /wp-admin/edit.php3.86 ▲0.2240.40 ▲1.77
Add New Post /wp-admin/post-new.php7.17 ▲0.1998.55 ▼1,215.36
Media Library /wp-admin/upload.php3.58 ▲0.2827.09 ▼0.80
Settings /wp-admin/admin.php?page=msbd_adsmp_settings3.4823.83
Add New /wp-admin/admin.php?page=msbd_adsmp_add_edit3.4934.24
Management Advertisement /wp-admin/admin.php?page=msbd_adsmp_manage3.5324.44
Instructions /wp-admin/admin.php?page=msbd_adsmp_instructions3.4823.63

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 17 new files
Database: 2 new tables, 2 new options
New tables
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by Ads Management
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,808 ▲5415.90 ▲0.256.27 ▲0.562.09 ▼0.64
Dashboard /wp-admin2,936 ▲786.04 ▼0.17119.68 ▼16.00179.73 ▲21.39
Posts /wp-admin/edit.php2,733 ▲393.14 ▼0.1170.45 ▲5.27149.86 ▲10.88
Add New Post /wp-admin/post-new.php1,781 ▲6220.95 ▼0.83417.32 ▼15.03180.54 ▲25.25
Media Library /wp-admin/upload.php1,739 ▲415.53 ▲0.00127.25 ▼21.34205.49 ▲12.97
Settings /wp-admin/admin.php?page=msbd_adsmp_settings1,3905.35163.46141.11
Add New /wp-admin/admin.php?page=msbd_adsmp_add_edit1,5956.08167.12126.78
Management Advertisement /wp-admin/admin.php?page=msbd_adsmp_manage1,4275.35116.25122.51
Instructions /wp-admin/admin.php?page=msbd_adsmp_instructions1,3315.85102.92143.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_msbd_adsmp_adv_to_categories
    • wp_msbd_adsmp
  • Zombie WordPress options detected upon uninstall: 2 options
    • category_children
    • msbd_adsmp_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please fix the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'MsbdCrud' not found in wp-content/plugins/ads-management/libs/msbd-adsm-db.php:6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ads-management/libs/msbd-adsm-admin-tables.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/ads-management/ads-management.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/ads-management/libs/msbd-adsm-admin-tables.php on line 7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/ads-management/libs/msbd-adsm-admin-tables.php on line 7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=msbd_adsmp_settings
    • > Network (severe)
    https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&annotation=inline&width=216&origin=http%3A%2F%2Fwp.com&url=https%3A%2F%2Fwww.google.com%2F%2BMicrosolutionsbd&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fabc-static%2F_%2Fjs%2Fk%3Dgapi.lb.en.NnK9YPjtg-w.O%2Fd%3D1%2Frs%3DAHpOoo9KePDGVlGjp-rlXwDM1kUO2Eh4gg%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh&id=I0_1648488889354&_gfid=I0_1648488889354&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=10257625 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=msbd_adsmp_add_edit
    • > Network (severe)
    https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&annotation=inline&width=216&origin=http%3A%2F%2Fwp.com&url=https%3A%2F%2Fwww.google.com%2F%2BMicrosolutionsbd&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fabc-static%2F_%2Fjs%2Fk%3Dgapi.lb.en.NnK9YPjtg-w.O%2Fd%3D1%2Frs%3DAHpOoo9KePDGVlGjp-rlXwDM1kUO2Eh4gg%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh&id=I0_1648488891687&_gfid=I0_1648488891687&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=30502556 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=msbd_adsmp_manage
    • > Network (severe)
    https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&annotation=inline&width=216&origin=http%3A%2F%2Fwp.com&url=https%3A%2F%2Fwww.google.com%2F%2BMicrosolutionsbd&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fabc-static%2F_%2Fjs%2Fk%3Dgapi.lb.en.NnK9YPjtg-w.O%2Fd%3D1%2Frs%3DAHpOoo9KePDGVlGjp-rlXwDM1kUO2Eh4gg%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh&id=I0_1648488893762&_gfid=I0_1648488893762&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=36001902 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=msbd_adsmp_instructions
    • > Network (severe)
    https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&annotation=inline&width=216&origin=http%3A%2F%2Fwp.com&url=https%3A%2F%2Fwww.google.com%2F%2BMicrosolutionsbd&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fabc-static%2F_%2Fjs%2Fk%3Dgapi.lb.en.NnK9YPjtg-w.O%2Fd%3D1%2Frs%3DAHpOoo9KePDGVlGjp-rlXwDM1kUO2Eh4gg%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh&id=I0_1648488895652&_gfid=I0_1648488895652&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=44330769 - Failed to load resource: the server responded with a status of 404 ()


Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: adsense, google adsense, affiliate advertising, manage ads, manage advertisements...

ads-management/ads-management.php 92% from 13 tests

This is the main PHP file of "Ads Management" version 0.2.2, 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:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin1,588 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity25.38
▷ Minimum class complexity4.00
▷ Maximum class complexity40.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
▷ Static methods89.76%
▷ Public methods82100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions2100.00%
▷ Anonymous functions00.00%
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/msbd_logo.png28.81KB9.10KB▼ 68.41%