68% media-net-ads-manager

Code Review | Media.net Ads Manager

WordPress plugin Media.net Ads Manager scored68%from 54 tests.

About plugin

  • Plugin page: media-net-ads-man...
  • Plugin version: 2.10.13
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.7
  • WordPress version: 6.3.1
  • First release: Feb 5, 2018
  • Latest release: May 4, 2021
  • Number of updates: 102
  • Update frequency: every 11.7 days
  • Top authors: mnetadmanager (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /107,441 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.62MB] [CPU: ▼5.51ms] Passed 4 tests

This is a short check of server-side resources used by Media.net Ads Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.38 ▲0.9156.70 ▲10.63
Dashboard /wp-admin3.92 ▲0.6153.18 ▼3.98
Posts /wp-admin/edit.php3.95 ▲0.5954.40 ▲2.98
Add New Post /wp-admin/post-new.php6.61 ▲0.7281.87 ▼23.02
Media Library /wp-admin/upload.php3.78 ▲0.5541.81 ▲1.98

Server storage [IO: ▲2.15MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 138 new files
Database: 8 new tables, 10 new options
New tables
wp_mnet_ad_tags
wp_mnet_external_ad
wp_mnet_ad_slots
wp_mnet_ad_post_mapping
wp_mnet_blocked_urls
wp_mnet_slot_blocked_urls
wp_mnet_ad_paragraph_mapping
wp_mnet_log_retry
New WordPress options
MNET_DB_VERSION
widget_theysaidso_widget
widget_mnet_widget_above
widget_recent-comments
db_upgraded
MNET_PLUGIN_VERSION
can_compress_scripts
widget_recent-posts
widget_mnet_widget_below
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Media.net Ads Manager
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.24 ▼0.281.78 ▲0.0745.83 ▲3.23
Dashboard /wp-admin2,197 ▲175.54 ▼0.0795.76 ▼5.9284.67 ▲38.27
Posts /wp-admin/edit.php2,114 ▲111.97 ▲0.0037.99 ▲0.5333.65 ▼2.01
Add New Post /wp-admin/post-new.php1,556 ▲2122.96 ▲4.57700.82 ▲45.7157.39 ▼11.61
Media Library /wp-admin/upload.php1,408 ▲54.20 ▼0.0396.86 ▼2.2977.44 ▲35.12

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure failed, leaving 8 tables in the database
    • wp_mnet_ad_post_mapping
    • wp_mnet_slot_blocked_urls
    • wp_mnet_ad_tags
    • wp_mnet_ad_paragraph_mapping
    • wp_mnet_external_ad
    • wp_mnet_ad_slots
    • wp_mnet_blocked_urls
    • wp_mnet_log_retry
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_mnet_widget_below
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_mnet_widget_above

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/media-net-ads-manager/app/views/MnetBundleLoadError.php
    • > /wp-content/plugins/media-net-ads-manager/app/views/mnetAnalytics.php
    • > /wp-content/plugins/media-net-ads-manager/index.php
    • > /wp-content/plugins/media-net-ads-manager/app/views/mnetBundleLoader.php
    • > /wp-content/plugins/media-net-ads-manager/app/views/adBlockHandler.php
    • > /wp-content/plugins/media-net-ads-manager/uninstall.php
  • 68× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/media-net-ads-manager/app/public/widgets/mnet_ad_widget_below.php:5
    • > PHP Warning
      Use of undefined constant MNET_AD_POSITION_BELOW_POST_LISTING - assumed 'MNET_AD_POSITION_BELOW_POST_LISTING' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-net-ads-manager/app/utils/adPresets.php on line 7
    • > PHP Warning
      Use of undefined constant MNET_AD_POSITION_ABOVE_POST_LISTING - assumed 'MNET_AD_POSITION_ABOVE_POST_LISTING' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-net-ads-manager/app/utils/adPresets.php on line 15
    • > PHP Warning
      Use of undefined constant MNET_AD_SIZE_300x250 - assumed 'MNET_AD_SIZE_300x250' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-net-ads-manager/app/utils/adPresets.php on line 29
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Comment' not found in wp-content/plugins/media-net-ads-manager/app/public/MnetCommentWalker.php:4
    • > PHP Warning
      Use of undefined constant MNET_AD_SIZE_300x250 - assumed 'MNET_AD_SIZE_300x250' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-net-ads-manager/app/utils/adPresets.php on line 11
    • > PHP Warning
      Use of undefined constant MNET_AD_SIZE_336x280 - assumed 'MNET_AD_SIZE_336x280' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-net-ads-manager/app/utils/adPresets.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mnet_normalize_chunks() in wp-content/plugins/media-net-ads-manager/app/views/mnetScripts.php:21
    • > PHP Warning
      Use of undefined constant MNET_AD_SIZE_728x90 - assumed 'MNET_AD_SIZE_728x90' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-net-ads-manager/app/utils/adPresets.php on line 29
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/media-net-ads-manager/app/public/widgets/mnet_ad_widget_above.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: beta, mnet ads, medianet, medianet ads manager, ads manager

media-net-ads-manager/index.php 92% from 13 tests

The main file in "Media.net Ads Manager" v. 2.10.13 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("media-net-ads-manager.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin7,427 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
PHP751,2301,6806,791
Markdown2840218
JSON700187
SVG302107
JavaScript7113105
XML10018
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity15.58
▷ Minimum class complexity1.00
▷ Maximum class complexity135.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces10
Interfaces2
Traits2
Classes51
▷ Abstract classes23.92%
▷ Concrete classes4996.08%
▷ Final classes00.00%
Methods455
▷ Static methods28662.86%
▷ Public methods42493.19%
▷ Protected methods112.42%
▷ Private methods204.40%
Functions35
▷ Named functions822.86%
▷ Anonymous functions2777.14%
Constants51
▷ Global constants4180.39%
▷ Class constants1019.61%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
32 compressed PNG files occupy 0.24MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Between Post Listing.png1.02KB1.01KB▼ 1.44%
images/After Post.png1.31KB1.29KB▼ 1.79%
images/After Title.png1.14KB1.13KB▼ 1.03%
images/After Content.png0.77KB0.76KB▼ 1.77%
images/Static Page.png1.27KB1.25KB▼ 1.08%