78% ads-mania

Code Review | ADS MANIA

WordPress plugin ADS MANIA scored 78% from 54 tests.

About plugin

  • Plugin page: ads-mania
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.0
  • WordPress version: 5.9.2
  • First release: Jul 17, 2015
  • Latest release: Jul 17, 2015
  • Number of updates: 11
  • Update frequency: every 0.1 days
  • Top authors: bakrianoo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 762 total downloads


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

This is a short check of server-side resources used by ADS MANIA
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1157.40 ▲1.83
Dashboard /wp-admin3.49 ▲0.0841.33 ▲4.49
Posts /wp-admin/edit.php3.72 ▲0.0840.68 ▲0.14
Add New Post /wp-admin/post-new.php6.95 ▼0.02102.05 ▼1,204.09
Media Library /wp-admin/upload.php3.37 ▲0.0826.50 ▼7.30
Add New Ads /wp-admin/post-new.php?post_type=ads_post3.8844.04
All Ads /wp-admin/edit.php?post_type=ads_post3.4227.98
Ads /wp-admin/options-general.php?page=adsmania_settings3.3725.39
Ads Genre /wp-admin/edit-tags.php?taxonomy=ads_genre&post_type=ads_post3.3728.07

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 7 new options
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for ADS MANIA
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,963 ▲20916.67 ▲0.998.83 ▲2.931.98 ▼0.68
Dashboard /wp-admin2,949 ▲916.97 ▲0.65125.57 ▼11.90112.30 ▼55.05
Posts /wp-admin/edit.php2,754 ▲633.63 ▲0.4098.00 ▲35.81104.82 ▼39.80
Add New Post /wp-admin/post-new.php1,728 ▲915.33 ▼7.05371.06 ▼63.10163.92 ▲5.10
Media Library /wp-admin/upload.php1,792 ▲946.27 ▲0.77122.39 ▼19.78196.99 ▲8.04
Add New Ads /wp-admin/post-new.php?post_type=ads_post3,4266.60113.86108.86
All Ads /wp-admin/edit.php?post_type=ads_post1,4783.3981.1788.85
Ads /wp-admin/options-general.php?page=adsmania_settings1,3753.5972.1986.81
Ads Genre /wp-admin/edit-tags.php?taxonomy=ads_genre&post_type=ads_post1,7173.3579.1286.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • ads_sett_ic_bg
    • ads_sett_c_ads
    • ads_sett_i_ads
    • ads_sett_c_max_ads
    • ads_sett_ic_close
    • ads_sett_user_cont_msg
    • ads_sett_click_cont_msg

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
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=ads_post
    • > User deprecated in wp-includes/functions.php+5316
    get_all_category_ids is deprecated since version 4.0.0! Use get_terms() instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ads-mania/admin/partials/ads_post_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_custom() in wp-content/plugins/ads-mania/admin/partials/ads_post_options.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test


Plugin configuration 93% from 29 tests

readme.txt 94% 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
Attributes that require attention:
  • Contributors: Contributors not specified
The official readme.txt is a good inspiration

ads-mania/adsmania.php 92% from 13 tests

The principal PHP file in "ADS MANIA" v. 1.4 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ads-mania.php" instead of "adsmania.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
No dangerous file extensions were detected1,468 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PO File195104208

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity22.14
▷ Minimum class complexity1.00
▷ Maximum class complexity100.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods4690.20%
▷ Protected methods00.00%
▷ Private methods59.80%
▷ Named functions18.33%
▷ Anonymous functions1191.67%
▷ Global constants00.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
14 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
admin/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.27KB0.14KB▼ 47.84%
admin/css/images/ui-icons_228ef1_256x240.png4.44KB4.17KB▼ 6.02%
admin/css/images/ui-bg_glass_100_f6f6f6_1x400.png0.26KB0.12KB▼ 53.44%
admin/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%