67% custom-post-ads

Code Review | Custom Post Ads

WordPress plugin Custom Post Ads scored67%from 54 tests.

About plugin

  • Plugin page: custom-post-ads
  • 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 4, 2022
  • Latest release: Jun 4, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: vikasratudi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /358 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.14MB] [CPU: ▼16.78ms] Passed 4 tests

A check of server-side resources used by Custom Post Ads
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0644.69 ▲3.90
Dashboard /wp-admin3.22 ▼0.0829.34 ▼23.40
Posts /wp-admin/edit.php3.30 ▼0.0632.59 ▼16.99
Add New Post /wp-admin/post-new.php5.48 ▼0.4069.99 ▼22.79
Media Library /wp-admin/upload.php3.19 ▼0.0429.16 ▼3.94
Custom Post Ads /wp-admin/admin.php?page=vfcustompostads3.2129.48
More /wp-admin/admin.php?page=vfcustompostads-more3.2128.65

Server storage [IO: ▲0.14MB] [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: 17 new files
Database: 1 new table, 6 new options
New tables
wp_vfcustompostads
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Custom Post Ads: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,996 ▲26114.80 ▲0.122.03 ▲0.2338.40 ▼0.47
Dashboard /wp-admin2,375 ▲1876.51 ▲1.58132.98 ▲20.3743.95 ▼2.05
Posts /wp-admin/edit.php2,284 ▲1953.36 ▲1.3555.01 ▲15.5135.77 ▼0.75
Add New Post /wp-admin/post-new.php1,554 ▲3723.70 ▲6.25593.45 ▼84.1334.63 ▼18.32
Media Library /wp-admin/upload.php1,420 ▲324.24 ▼0.0179.97 ▼18.1940.84 ▼2.19
Custom Post Ads /wp-admin/admin.php?page=vfcustompostads2,3123.2039.32103.31
More /wp-admin/admin.php?page=vfcustompostads-more1,0363.1641.3726.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_vfcustompostads
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vfcustompostads-more
    • > 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
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/custom-post-ads/inc/custompostads-structure.php
    • > /wp-content/plugins/custom-post-ads/inc/db.php
    • > /wp-content/plugins/custom-post-ads/inc/vfcustompostads-cmsoon.php
    • > /wp-content/plugins/custom-post-ads/vfcustompostads.php
    • > /wp-content/plugins/custom-post-ads/uninstall.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
Attributes that require attention:
  • Contributors: Contributors not specified
The official readme.txt might help

custom-post-ads/vfcustompostads.php 85% from 13 tests

The main PHP file in "Custom Post Ads" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("custom-post-ads.php" instead of "vfcustompostads.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,751 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
CSS2451778
PHP69332727
SVG600142
JavaScript1271104

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/images/fb_play.png0.97KB0.00KB▼ 100.00%