66% my-custom-ads

Code Review | My Custom Ads Management

WordPress plugin My Custom Ads Management scored66%from 54 tests.

About plugin

  • Plugin page: my-custom-ads
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.6
  • WordPress version: 6.3.1
  • First release: Dec 24, 2017
  • Latest release: Jul 3, 2018
  • Number of updates: 4
  • Update frequency: every 47.7 days
  • Top authors: pixeltoweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /832 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.30ms] Passed 4 tests

This is a short check of server-side resources used by My Custom Ads Management
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0145.77 ▲9.49
Dashboard /wp-admin3.32 ▼0.0249.57 ▼11.31
Posts /wp-admin/edit.php3.37 ▲0.0244.63 ▼4.04
Add New Post /wp-admin/post-new.php5.92 ▲0.0480.37 ▼24.13
Media Library /wp-admin/upload.php3.25 ▲0.0237.06 ▲2.29
Manage Custom-Ads /wp-admin/admin.php?page=customads-listing3.1932.58
Help /wp-admin/admin.php?page=help3.2428.93

Server storage [IO: ▲0.04MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: 1 new table, 7 new options
New tables
wp_customads
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_mycustomads_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Custom Ads Management
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲8414.36 ▲0.011.96 ▲0.3945.01 ▲4.01
Dashboard /wp-admin2,229 ▲495.64 ▼0.0393.83 ▲8.5943.56 ▲0.20
Posts /wp-admin/edit.php2,131 ▲312.04 ▲0.0840.40 ▲3.8036.86 ▲1.34
Add New Post /wp-admin/post-new.php1,552 ▲2623.25 ▼0.49655.30 ▼30.4357.87 ▼3.88
Media Library /wp-admin/upload.php1,428 ▲314.18 ▼0.09102.71 ▼7.1046.44 ▼3.16
Manage Custom-Ads /wp-admin/admin.php?page=customads-listing9612.0028.2928.80
Help /wp-admin/admin.php?page=help8871.9922.2527.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_mycustomads_widget
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=customads-listing
    • > Notice in wp-content/plugins/my-custom-ads/mycustomads_function.php+61
    Undefined index: original_publish
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=customads-listing
    • > Notice in wp-content/plugins/my-custom-ads/mycustomads_function.php+84
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=customads-listing
    • > Notice in wp-content/plugins/my-custom-ads/mycustomads_function.php+69
    Undefined index: action2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=customads-listing
    • > Notice in wp-content/plugins/my-custom-ads/admin/ads_inventory_details.php+25
    Undefined variable: customadsArray
    • > GET request to /wp-admin/admin.php?page=customads-listing
    • > Warning in wp-content/plugins/my-custom-ads/admin/ads_inventory_details.php+144
    usort() expects parameter 1 to be array, null given
    • > GET request to /wp-admin/admin.php?page=customads-listing
    • > Warning in wp-content/plugins/my-custom-ads/admin/ads_inventory_details.php+146
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=customads-listing
    • > Warning in wp-content/plugins/my-custom-ads/admin/ads_inventory_details.php+147
    array_slice() expects parameter 1 to be array, null given
    • > GET request to /wp-admin/admin.php?page=customads-listing
    • > Notice in wp-content/plugins/my-custom-ads/admin/ads_inventory_details.php+163
    Undefined variable: message

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 take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/my-custom-ads/admin/help.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/my-custom-ads/mycustomads_function.php:98
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/my-custom-ads/admin/edit_customads.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/my-custom-ads/admin/ads_inventory_details.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/my-custom-ads/admin/ads_inventory_details.php on line 3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/my-custom-ads/mycustomads.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/my-custom-ads/mycustomads.php:18
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/my-custom-ads/admin/ads_inventory_details.php on line 3
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/my-custom-ads/admin/edit_customads.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=help
    • > Network (severe)
    wp-content/plugins/mycustomads/css/customads_css.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=help
    • > Network (severe)
    wp-content/plugins/mycustomads/js/customads_js.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (36 tag instead of maximum 10)
The official readme.txt is a good inspiration

my-custom-ads/mycustomads.php 92% from 13 tests

The principal PHP file in "My Custom Ads Management" v. 1.0.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("my-custom-ads.php" instead of "mycustomads.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
No dangerous file extensions were detected839 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP63660539
JavaScript12430200
CSS220100

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity14.00
▷ Minimum class complexity13.00
▷ Maximum class complexity15.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin