10% private-ad

Code Review | Private Ad

WordPress plugin Private Ad scored10%from 54 tests.

About plugin

  • Plugin page: private-ad
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0
  • WordPress version: 6.3.1
  • First release: Jun 25, 2022
  • Latest release: Jun 25, 2022
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: mntiwari21 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /313 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/private-ad/private_ad.php+282
    Undefined variable: first_ad_code

Server metrics [RAM: ▼1.88MB] [CPU: ▼56.89ms] Passed 4 tests

An overview of server-side resources used by Private Ad
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.364.87 ▼40.74
Dashboard /wp-admin2.13 ▼1.185.51 ▼46.68
Posts /wp-admin/edit.php2.13 ▼1.236.48 ▼42.18
Add New Post /wp-admin/post-new.php2.13 ▼3.766.56 ▼97.95
Media Library /wp-admin/upload.php2.13 ▼1.105.16 ▼30.34
My Categories /wp-admin/admin.php?page=my-categories2.136.23
Advertisement /wp-admin/admin.php?page=private-advertisement2.138.21
My Ads /wp-admin/admin.php?page=my-ads2.135.98

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: 1 new table, 6 new options
New tables
wp_privatead
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Private Ad
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲17414.54 ▲0.371.96 ▼0.0942.73 ▼0.60
Dashboard /wp-admin2,369 ▲1926.11 ▲0.46117.72 ▲20.7337.03 ▼5.67
Posts /wp-admin/edit.php2,297 ▲1943.41 ▲1.4146.08 ▲4.6030.35 ▼10.93
Add New Post /wp-admin/post-new.php1,555 ▲2923.78 ▲0.72659.98 ▼34.2336.56 ▼16.92
Media Library /wp-admin/upload.php1,437 ▲404.12 ▼0.0382.78 ▼32.3646.98 ▼3.10
My Categories /wp-admin/admin.php?page=my-categories1,1093.1945.5559.05
Advertisement /wp-admin/admin.php?page=private-advertisement1,2513.2152.4156.77
My Ads /wp-admin/admin.php?page=my-ads1,1553.1941.5031.00

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/private-ad/private_ad.php+282
    Undefined variable: first_ad_code
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my-ads
    • > Notice in wp-content/plugins/private-ad/private_ad.php+282
    Undefined variable: first_ad_code
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my-ads
    • > User notice in wp-includes/functions.php+5905
    Function is_single was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my-ads
    • > 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.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my-ads
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my-ads
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)
    • > GET request to /wp-admin/admin.php?page=my-ads
    • > Notice in wp-content/plugins/private-ad/advertisement_view/my_ads.php+150
    Undefined variable: id

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/private-ad/private_ad.php
    • > /wp-content/plugins/private-ad/advertisement_view/firstview_of_ad.php
    • > /wp-content/plugins/private-ad/advertisement_view/my_ads.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_categories() in wp-content/plugins/private-ad/advertisement_view/categories.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_categories() in wp-content/plugins/private-ad/advertisement_view/firstview_of_ad.php:251

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my-ads
    • > Network (severe)
    wp-content/plugins/private-ad/assets/private_ad_css/advertisement.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my-ads
    • > Network (severe)
    wp-content/plugins/private-ad/assets/private_ad_js/advertisement.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my-ads
    • > Network (severe)
    wp-content/plugins/private-ad/assets/projs/proicon.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This is the screenshot of the advertisement tab (Screenshot-1.png).), #2 (This is the screenshot of the categories tab ( Screenshot-2.png).), #3 (This is the screenshot of my ads tab (Screenshot-3.png).), #4 (This is the screenshot of the preview of your ad (Screenshot-4.png).), #5 (This is the screenshot of dropdown categories (Screenshot-5.png).)
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
  • Contributors: Plugin contributors not specified
The official readme.txt might help

private-ad/private_ad.php 85% from 13 tests

Analyzing the main PHP file in "Private Ad" version 1.0
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("private-ad.php" instead of "private_ad.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin868 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP418051851
JavaScript22616
CSS1061

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions1184.62%
▷ Anonymous functions215.38%
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 are no PNG files in this plugin