84% wp-post-background

Code Review | WP Post Background

WordPress plugin WP Post Background scored84%from 54 tests.

About plugin

  • Plugin page: wp-post-background
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 6.3.1
  • First release: May 16, 2015
  • Latest release: May 16, 2015
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: jcchavezs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,906 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by WP Post Background
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.54 ▲3.79
Dashboard /wp-admin3.34 ▲0.0453.31 ▼2.16
Posts /wp-admin/edit.php3.39 ▲0.0450.95 ▼2.74
Add New Post /wp-admin/post-new.php5.93 ▲0.0590.66 ▼12.81
Media Library /wp-admin/upload.php3.26 ▲0.0437.52 ▲2.81

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP Post Background
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.17 ▼1.131.70 ▼0.8443.62 ▼3.51
Dashboard /wp-admin2,208 ▲234.87 ▼0.97112.42 ▲9.4543.38 ▼2.32
Posts /wp-admin/edit.php2,103 ▲142.23 ▲0.2438.56 ▼0.9136.17 ▲4.53
Add New Post /wp-admin/post-new.php6,233 ▲4,70021.58 ▼1.61897.73 ▲208.0457.20 ▲1.79
Media Library /wp-admin/upload.php1,389 ▲14.26 ▼0.0299.33 ▼15.9142.84 ▼9.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-post-background/wp-post-background.php:14

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)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: background, attachment, plugin, post

wp-post-background/wp-post-background.php Passed 13 tests

The entry point to "WP Post Background" version 1.0.0 is a PHP file that has certain tags in its header comment area
134 characters long description:
This plugin allows you to add and image as background of posts, pages or custom post type in general (in the same way as a thumbnail).

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
Success! There were no dangerous files found in this plugin225 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP14883140
JavaScript121132
PO File151029
Markdown113024

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin