10% ultimate-ads-manager

Code Review | Ultimate Ads Manager

WordPress plugin Ultimate Ads Manager scored 10% from 54 tests.

About plugin

  • Plugin page: ultimate-ads-manager
  • Plugin version: 2.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4
  • WordPress version: 5.9.2
  • First release: Jun 15, 2015
  • Latest release: Apr 2, 2020
  • Number of updates: 74
  • Update frequency: every 23.7 days
  • Top authors: denis_golovin (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

1,000+ active / 40,583 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/ultimate-ads-manager/includes/common.php+60
    Trying to access array offset on value of type null

Server metrics [RAM: ▼2.53MB] [CPU: ▼346.54ms] Passed 4 tests

Server-side resources used by Ultimate Ads Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.84 ▼1.674.04 ▼48.54
Dashboard /wp-admin1.86 ▼1.554.62 ▼28.36
Posts /wp-admin/edit.php1.86 ▼1.784.20 ▼31.78
Add New Post /wp-admin/post-new.php1.86 ▼5.113.86 ▼1,276.96
Media Library /wp-admin/upload.php1.86 ▼1.443.49 ▼28.88
Groups /wp-admin/edit.php?post_type=codeneric_ad_group1.864.14
Adverts /wp-admin/edit.php?post_type=codeneric_ad1.864.21
Settings /wp-admin/edit.php?post_type=codeneric_ad&page=settings1.863.86
Statistics /wp-admin/edit.php?post_type=codeneric_ad&page=statistics1.868.10
Premium /wp-admin/edit.php?post_type=codeneric_ad&page=uam-premium1.863.61
Places /wp-admin/edit.php?post_type=codeneric_ad_place1.864.51
Support /wp-admin/edit.php?post_type=codeneric_ad&page=codeneric_uam_support1.863.90

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 78 new files
Database: 1 new table, 8 new options
New tables
wp_codeneric_uam_events
New WordPress options
_site_transint_timeout_browser_a7cef1c8465454dd4238b5bc2f2e819
uam_redirect_parent_folder_name_expiration_time
widget_codeneric_ad_widget
codeneric_uam_register_status
codeneric_uam_activation_date
cc_ads_manage_curr_version
uam_redirect_parent_folder_name
codeneric_uam_uuid

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ultimate Ads Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,904 ▲16217.74 ▲2.1627.15 ▲19.382.22 ▼0.17
Dashboard /wp-admin2,979 ▲1286.17 ▲0.00119.38 ▼11.52168.39 ▲8.59
Posts /wp-admin/edit.php2,783 ▲893.24 ▲0.0164.62 ▲1.52140.13 ▲2.53
Add New Post /wp-admin/post-new.php1,720 ▲119.32 ▼2.80386.87 ▼24.45157.43 ▲1.39
Media Library /wp-admin/upload.php1,787 ▲895.53 ▲0.00138.37 ▼4.91200.70 ▲13.14
Groups /wp-admin/edit.php?post_type=codeneric_ad_group1,5013.1761.18123.79
Adverts /wp-admin/edit.php?post_type=codeneric_ad1,6223.2367.23122.60
Settings /wp-admin/edit.php?post_type=codeneric_ad&page=settings1,5227.04218.20196.35
Statistics /wp-admin/edit.php?post_type=codeneric_ad&page=statistics1,0933.3769.24142.06
Premium /wp-admin/edit.php?post_type=codeneric_ad&page=uam-premium1,2215.95165.55131.25
Places /wp-admin/edit.php?post_type=codeneric_ad_place1,5013.1762.67122.75
Support /wp-admin/edit.php?post_type=codeneric_ad&page=codeneric_uam_support1,4612.4254.19170.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/ultimate-ads-manager/includes/common.php+60
    Trying to access array offset on value of type null
  • Zombie tables detected upon uninstall: 1 table
    • wp_codeneric_uam_events
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • cc_ads_manage_curr_version
    • widget_codeneric_ad_widget
    • _site_transint_timeout_browser_a7cef1c8465454dd4238b5bc2f2e819
    • codeneric_uam_activation_date
    • uam_redirect_parent_folder_name_expiration_time
    • codeneric_uam_register_status
    • codeneric_uam_uuid
    • uam_redirect_parent_folder_name

Smoke tests 0% 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
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=codeneric_ad&page=codeneric_uam_support
    • > Notice in wp-content/plugins/ultimate-ads-manager/includes/common.php+62
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=codeneric_ad&page=statistics
    • > User notice in wp-includes/functions.php+5768
    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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/ultimate-ads-manager/public/partials/public-display.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ultimate-ads-manager/admin/widget.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/ultimate-ads-manager/admin/elementor/elementor-widget.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/ultimate-ads-manager/admin/partials/admin-widget.php:51
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/ultimate-ads-manager/tests/bootstrap.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/ultimate-ads-manager/tests/test-config.php:11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-ads-manager/admin/partials/admin-widget.php on line 47
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/ultimate-ads-manager/tests/bootstrap.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_title() in wp-content/plugins/ultimate-ads-manager/public/partials/public-template.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function deactivate_plugins() in wp-content/plugins/ultimate-ads-manager/admin/class-ultimate-ads-manager-admin.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ultimate-ads-manager/admin/elementor/elementor.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=codeneric_ad&page=settings
    • > Network (severe)
    wp-admin/admin-ajax.php - Failed to load resource: the server responded with a status of 400 (Bad Request)
    • > GET request to /wp-admin/edit.php?post_type=codeneric_ad&page=uam-premium
    • > Network (severe)
    https://headgame.draco.uberspace.de/wpps/paid?plugin_id=774f1eeb-a6be-4225-a9cd-df3a634adc26 - Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === ultimate-ads-manager === )
You can look at the official readme.txt

ultimate-ads-manager/ultimate-ads-manager.php Passed 13 tests

The main PHP script in "Ultimate Ads Manager" version 2.4.1 is automatically included on every request by WordPress
78 characters long description:
Display advertisements on your website and get reports about clicks and views.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin5,007 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP461,5891,4054,171
HTML27720447
JavaScript1127264302
PO File1131343
CSS23822
XML22022

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity16.07
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods197
▷ Static methods5226.40%
▷ Public methods17488.32%
▷ Protected methods21.02%
▷ Private methods2110.66%
Functions26
▷ Named functions2596.15%
▷ Anonymous functions13.85%
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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banktransfer.png3.75KB2.43KB▼ 35.24%
assets/icon-128x128.PNG2.72KB1.68KB▼ 38.29%
assets/paypal.png3.07KB2.98KB▼ 3.08%
assets/creditcard.png0.51KB0.30KB▼ 40.77%