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: 6.3.1
  • 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 / 905 total downloads

Benchmarks

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

A check of server-side resources used by ADS MANIA
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2945.81 ▲3.23
Dashboard /wp-admin3.61 ▲0.3148.84 ▼1.09
Posts /wp-admin/edit.php3.70 ▲0.3552.92 ▲9.65
Add New Post /wp-admin/post-new.php6.19 ▲0.3090.55 ▼9.76
Media Library /wp-admin/upload.php3.51 ▲0.2838.65 ▲3.63
Ads Genre /wp-admin/edit-tags.php?taxonomy=ads_genre&post_type=ads_post3.5136.67
Ads /wp-admin/options-general.php?page=adsmania_settings3.4834.24
Add New Ads /wp-admin/post-new.php?post_type=ads_post3.7147.33
All Ads /wp-admin/edit.php?post_type=ads_post3.5539.43

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 42 new files
Database: no new tables, 13 new options
New WordPress options
ads_sett_ic_bg
db_upgraded
can_compress_scripts
ads_sett_c_max_ads
widget_recent-posts
ads_sett_ic_close
ads_sett_click_cont_msg
widget_theysaidso_widget
theysaidso_admin_options
ads_sett_user_cont_msg
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for ADS MANIA
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,985 ▲22814.07 ▼0.285.86 ▲3.7543.63 ▼7.79
Dashboard /wp-admin2,275 ▲875.32 ▲0.28112.96 ▲11.4438.30 ▼2.55
Posts /wp-admin/edit.php2,156 ▲672.18 ▲0.1945.77 ▲11.9637.74 ▲3.57
Add New Post /wp-admin/post-new.php1,749 ▲23524.82 ▲7.35646.95 ▼53.2146.84 ▼20.80
Media Library /wp-admin/upload.php1,474 ▲894.51 ▲0.3490.02 ▼13.1643.86 ▼2.17
Ads Genre /wp-admin/edit-tags.php?taxonomy=ads_genre&post_type=ads_post1,3502.6236.9850.37
Ads /wp-admin/options-general.php?page=adsmania_settings1,0692.4645.5428.36
Add New Ads /wp-admin/post-new.php?post_type=ads_post2,5184.5482.1836.57
All Ads /wp-admin/edit.php?post_type=ads_post1,1202.6239.2628.94

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 13 options in the database
    • ads_sett_c_max_ads
    • theysaidso_admin_options
    • ads_sett_c_ads
    • widget_recent-comments
    • ads_sett_user_cont_msg
    • db_upgraded
    • ads_sett_click_cont_msg
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=ads_post
    • > User deprecated in wp-includes/functions.php+5453
    Function 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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Contributors: Contributors not specified
Please take inspiration from this readme.txt

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
It is important to fix the following:
  • Main file name: The principal 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 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin1,468 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP122456861,071
PO File195104208
CSS5111396
JavaScript3171893

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
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
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods51
▷ Static methods00.00%
▷ Public methods4690.20%
▷ Protected methods00.00%
▷ Private methods59.80%
Functions12
▷ Named functions18.33%
▷ Anonymous functions1191.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
admin/css/images/ui-bg_diagonals-thick_20_666666_40x40.png0.30KB0.15KB▼ 49.68%
admin/css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
admin/css/images/ui-icons_228ef1_256x240.png4.44KB4.17KB▼ 6.02%
admin/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%