62% opes-wp-ads-manager

Code Review | Opes WP Ads Manager

WordPress plugin Opes WP Ads Manager scored 62% from 54 tests.

About plugin

  • Plugin page: opes-wp-ads-manager
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.2.0
  • WordPress version: 6.3.1
  • First release: Apr 6, 2015
  • Latest release: Apr 25, 2015
  • Number of updates: 6
  • Update frequency: every 3.2 days
  • Top authors: twapaw (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,129 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Opes WP Ads Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1927.65 ▼11.72
Dashboard /wp-admin3.81 ▲0.5154.57 ▲4.23
Posts /wp-admin/edit.php3.64 ▲0.2935.42 ▼10.87
Add New Post /wp-admin/post-new.php5.88 ▼0.0068.25 ▼20.69
Media Library /wp-admin/upload.php3.67 ▲0.4539.84 ▲8.08
OWP Ads Manager /wp-admin/admin.php?page=wpadsmngr_uwxl_options3.5530.34
New ad /wp-admin/post-new.php?post_type=wpadsmngr_uwxl_ad3.6740.98
Ad sizes /wp-admin/admin.php?page=wpadsmngr_uwxl_options_ad_sizes3.5529.51
All ads /wp-admin/edit.php?post_type=wpadsmngr_uwxl_ad3.6231.73

Server storage [IO: ▲0.42MB] [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: 78 new files
Database: no new tables, 8 new options
New WordPress options
wpadsmngr_uwxl_options_positions_widgets
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
wpadsmngr_uwxl_options_ad_sizes
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Opes WP Ads Manager
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲20913.71 ▼0.885.77 ▲4.1748.25 ▲6.94
Dashboard /wp-admin2,246 ▲585.87 ▲0.99105.95 ▲3.3378.09 ▲35.77
Posts /wp-admin/edit.php2,158 ▲902.08 ▲0.0934.69 ▲1.3932.78 ▲1.25
Add New Post /wp-admin/post-new.php1,730 ▲18823.00 ▲4.72644.96 ▲43.9757.72 ▲4.21
Media Library /wp-admin/upload.php1,431 ▲434.12 ▼0.07105.10 ▲10.4350.23 ▲2.55
OWP Ads Manager /wp-admin/admin.php?page=wpadsmngr_uwxl_options9312.3563.2146.57
New ad /wp-admin/post-new.php?post_type=wpadsmngr_uwxl_ad3,8735.1694.3393.19
Ad sizes /wp-admin/admin.php?page=wpadsmngr_uwxl_options_ad_sizes1,0242.9275.6147.91
All ads /wp-admin/edit.php?post_type=wpadsmngr_uwxl_ad1,1592.0433.7330.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/opes-wp-ads-manager/inc/admin/controller/1-activation-Hook-ToLoad.php+34
    Undefined variable: _WPADSMNGR_uwxl__InitData
  • The uninstall procedure has failed, leaving 8 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • wpadsmngr_uwxl_options_ad_sizes
    • can_compress_scripts
    • widget_recent-comments
    • wpadsmngr_uwxl_options_positions_widgets

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 42 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wpadsmngr_uwxl_ad
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 50% 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
Please fix the following
  • 19× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/opes-wp-ads-manager/inc/admin/controller/3-Ad-Add-Admin-Column-ToLoad.php on line 104
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/opes-wp-ads-manager/inc/common/controller/1-restictions-ToLoad.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/opes-wp-ads-manager/inc/admin/controller/1-activation-Hook-ToLoad.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/opes-wp-ads-manager/opes-wp-ads-manager.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opes-wp-ads-manager/inc/admin/controller/2-Ad-Metaboxes-ToLoad.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opes-wp-ads-manager/inc/admin/controller/8-Add-Images-Sizes-ToLoad.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opes-wp-ads-manager/conf.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/opes-wp-ads-manager/inc/admin/controller/3-Ad-Add-Admin-Column-ToLoad.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opes-wp-ads-manager/inc/admin/controller/12-ajax-ToLoad.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/opes-wp-ads-manager/inc/common/controller/localize-scripts.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpadsmngr_uwxl_options_ad_sizes
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-accordion,jquery-ui-tabs,jquery-ui-controlgroup,jquery-ui-checkboxradi&load%5Bchunk_1%5D=o,jquery-ui-button,jquery-ui-spinner&ver=6.3.1 1:28721 Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The new child element contains the parent.
    • > GET request to /wp-admin/edit.php?post_type=wpadsmngr_uwxl_ad
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/opes-wp-ads-manager/inc/admin/assets/js/script-admin-ads-list.js?ver=1.2.0:6:44)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=wpadsmngr_uwxl_ad
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: ads, adverts, manager, ad, plugin...

opes-wp-ads-manager/opes-wp-ads-manager.php 92% from 13 tests

The main file in "Opes WP Ads Manager" v. 1.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin5,108 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript72951542,370
PHP186342932,250
CSS104418488

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity23.50
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods80
▷ Static methods2227.50%
▷ Public methods6176.25%
▷ Protected methods00.00%
▷ Private methods1923.75%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants39
▷ Global constants39100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
37 PNG files occupy 0.10MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/admin/assets/css/images/ui-bg_gloss-wave_100_ece8da_500x100.png5.62KB1.20KB▼ 78.68%
inc/admin/assets/images/unchecked_checkbox-40.png0.59KB0.49KB▼ 16.23%
inc/admin/assets/images/icon-20-red.png0.87KB0.93KB0.00%
inc/admin/assets/css/images/ui-bg_highlight-hard_95_cccccc_1x100.png0.25KB0.15KB▼ 38.49%
inc/admin/assets/css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%