84% wp-shortcode-advertising

Code Review | WP Shortcode Advertising

WordPress plugin WP Shortcode Advertising scored84%from 54 tests.

About plugin

  • Plugin page: wp-shortcode-adve...
  • Plugin version: 0.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-4.5.2
  • WordPress version: 6.3.1
  • First release: May 24, 2016
  • Latest release: May 24, 2016
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: QihaoHuang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,044 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.37ms] Passed 4 tests

An overview of server-side resources used by WP Shortcode Advertising
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0544.06 ▲2.55
Dashboard /wp-admin3.34 ▲0.0445.27 ▼2.39
Posts /wp-admin/edit.php3.39 ▲0.0449.92 ▲0.41
Add New Post /wp-admin/post-new.php5.93 ▲0.0489.69 ▼3.17
Media Library /wp-admin/upload.php3.27 ▲0.0432.91 ▼4.34

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Shortcode Advertising
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.72 ▼0.651.67 ▲0.0248.31 ▲1.68
Dashboard /wp-admin2,203 ▲124.86 ▼0.0198.94 ▼2.4440.99 ▼0.43
Posts /wp-admin/edit.php2,089 ▲32.03 ▼0.0240.51 ▲5.1435.94 ▲1.49
Add New Post /wp-admin/post-new.php1,514 ▼2117.56 ▼5.70716.47 ▲40.1755.65 ▲2.89
Media Library /wp-admin/upload.php1,388 ▲34.23 ▲0.13111.83 ▲4.1448.45 ▲6.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-shortcode-advertising/settings/template-profile-options.php
    • > /wp-content/plugins/wp-shortcode-advertising/wp-shortcode-advertising.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (/assets/option-page-screenshot.png)
Please take inspiration from this readme.txt

wp-shortcode-advertising/wp-shortcode-advertising.php Passed 13 tests

The principal PHP file in "WP Shortcode Advertising" v. 0.3.1 is loaded by WordPress automatically on each request
60 characters long description:
A plugin that allow you to insert advertising via shortcode.

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
Everything looks great! No dangerous files found in this plugin941 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP7189789831
PO File2161874
Markdown18019
JavaScript10517

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.78
Average class complexity51.00
▷ Minimum class complexity8.00
▷ Maximum class complexity134.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods49
▷ Static methods2346.94%
▷ Public methods4795.92%
▷ Protected methods24.08%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants637.50%
▷ Class constants1062.50%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.22MB with 0.13MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/advertising.png2.69KB2.07KB▼ 22.86%
assets/screenshot-1.png109.11KB25.56KB▼ 76.57%
assets/option-page-screenshot.png109.11KB25.56KB▼ 76.57%