62% wpadcenter

Code Review | WP AdCenter - Ad Manager & Adsense Ads

WordPress plugin WP AdCenter - Ad Manager & Adsense Ads scored 62% from 54 tests.

About plugin

  • Plugin page: wpadcenter
  • Plugin version: 2.5.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 24, 2020
  • Latest release: Aug 9, 2023
  • Number of updates: 74
  • Update frequency: every 16.7 days
  • Top authors: WPEka Club (85.14%)keyur5 (12.16%)pranay171727 (4.05%)smritichaturvedi (2.7%)

Code review

54 tests

User reviews

9 reviews

Install metrics

800+ active / 15,158 total downloads

Benchmarks

Plugin footprint 65% 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.21MB] [CPU: ▲0.37ms] Passed 4 tests

Server-side resources used by WP AdCenter - Ad Manager & Adsense Ads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2138.59 ▼0.36
Dashboard /wp-admin3.50 ▲0.1949.45 ▼0.30
Posts /wp-admin/edit.php3.61 ▲0.2646.41 ▲0.67
Add New Post /wp-admin/post-new.php6.21 ▲0.3286.73 ▲3.51
Media Library /wp-admin/upload.php3.42 ▲0.1935.94 ▲1.46
Create Ad /wp-admin/post-new.php?post_type=wpadcenter-ads3.5658.88
Getting Started /wp-admin/edit.php?post_type=wpadcenter-ads&page=wpadcenter-getting-started3.4035.28
Manage Ad Groups /wp-admin/edit-tags.php?taxonomy=wpadcenter-adgroups&post_type=wpadcenter-ads3.4244.87
Reports /wp-admin/edit.php?post_type=wpadcenter-ads&page=wpadcenter-reports3.4841.24
Manage Ads /wp-admin/edit.php?post_type=wpadcenter-ads3.4841.55
Settings /wp-admin/edit.php?post_type=wpadcenter-ads&page=wpadcenter-settings3.5034.84

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 904 new files
Database: 2 new tables, 13 new options
New tables
wp_ads_statistics
wp_placements_statistics
New WordPress options
widget_recent-posts
wpadcenter_migration_v2
wpadcenter_placement_db
wpadcenter_placement_table_install
can_compress_scripts
widget_recent-comments
WPAdCenter-Settings
widget_theysaidso_widget
wpadcenter_update_placements_5.2.3
wpadcenter_review_pending
...

Browser metrics Passed 4 tests

Checking browser requirements for WP AdCenter - Ad Manager & Adsense Ads
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲6413.25 ▼1.581.53 ▼0.2738.43 ▼8.26
Dashboard /wp-admin2,241 ▲355.83 ▼0.02111.74 ▲7.6884.40 ▲42.84
Posts /wp-admin/edit.php2,142 ▲532.05 ▲0.0636.66 ▲0.2632.22 ▼2.50
Add New Post /wp-admin/post-new.php6,495 ▲4,96123.80 ▲0.76880.16 ▲193.5545.80 ▼14.57
Media Library /wp-admin/upload.php1,438 ▲564.15 ▼0.0296.05 ▼4.3173.85 ▲26.92
Create Ad /wp-admin/post-new.php?post_type=wpadcenter-ads4,9918.24230.25116.35
Getting Started /wp-admin/edit.php?post_type=wpadcenter-ads&page=wpadcenter-getting-started1,4959.95301.0782.91
Manage Ad Groups /wp-admin/edit-tags.php?taxonomy=wpadcenter-adgroups&post_type=wpadcenter-ads1,2602.1829.6829.80
Reports /wp-admin/edit.php?post_type=wpadcenter-ads&page=wpadcenter-reports1,7868.34143.71103.58
Manage Ads /wp-admin/edit.php?post_type=wpadcenter-ads1,3682.4740.3945.02
Settings /wp-admin/edit.php?post_type=wpadcenter-ads&page=wpadcenter-settings1,6995.84100.8848.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_ads_statistics
    • wp_placements_statistics
  • Zombie WordPress options detected upon uninstall: 11 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • wpadcenter-version
    • wpadcenter_review_pending
    • WPAdCenter-Settings
    • wpadcenter_migration_v2
    • widget_recent-comments
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wpadcenter/vendor/mobiledetect/mobiledetectlib/export/exportToJSON.php
  • 120× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wpadcenter/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wpadcenter/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wpadcenter/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wpadcenter/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wpadcenter/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wpadcenter/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wpadcenter/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wpadcenter/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php:4
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/wpadcenter/vendor/composer/../symfony/polyfill-ctype/bootstrap.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpadcenter/vendor/composer/autoload_real.php on line 55
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wpadcenter/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=wpadcenter-ads
    • > Rendering (warning) in unknown
    /wp-admin/post-new.php?post_type=wpadcenter-ads 572 The specified value "#000" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/post-new.php?post_type=wpadcenter-ads
    • > Deprecation (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1 Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: There are too many tags (23 tag instead of maximum 10)
  • Requires at least: Invalid version format
The official readme.txt might help

wpadcenter/wpadcenter.php Passed 13 tests

The main PHP file in "WP AdCenter - Ad Manager & Adsense Ads" ver. 2.5.4 adds more information about the plugin and also serves as the entry point for this plugin
44 characters long description:
Advertising management plugin for WordPress.

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
No dangerous file extensions were detected146,665 lines of code in 790 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript26421,38117,72789,253
CSS1053,93573227,179
PHP1471,8653,80413,335
Sass1321,0115344,639
Markdown661,68404,598
JSON9003,194
SVG5012,722
YAML29560822
Twig24560557
HTML7650344
XML10020
Bourne Shell1002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity11.63
▷ Minimum class complexity1.00
▷ Maximum class complexity492.00
Average method complexity4.51
▷ Minimum method complexity1.00
▷ Maximum method complexity90.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes131
▷ Abstract classes10.76%
▷ Concrete classes13099.24%
▷ Final classes00.00%
Methods399
▷ Static methods6115.29%
▷ Public methods33483.71%
▷ Protected methods4611.53%
▷ Private methods194.76%
Functions16
▷ Named functions850.00%
▷ Anonymous functions850.00%
Constants29
▷ Global constants827.59%
▷ Class constants2172.41%
▷ Public constants21100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
79 PNG files occupy 1.05MB with 0.51MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/select2/select2/docs/pages/images/flags/ia.png6.94KB3.21KB▼ 53.75%
vendor/select2/select2/docs/pages/images/flags/nm.png1.49KB0.96KB▼ 35.13%
vendor/select2/select2/docs/pages/images/flags/ri.png6.76KB3.13KB▼ 53.76%
vendor/select2/select2/docs/pages/images/flags/ny.png9.50KB4.12KB▼ 56.68%
vendor/select2/select2/docs/pages/images/flags/wy.png4.24KB2.36KB▼ 44.30%