83% before-after-content

Code Review | Before After Content

WordPress plugin Before After Content scored 83% from 54 tests.

About plugin

  • Plugin page: before-after-content
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 5.8.1
  • First release: Nov 24, 2015
  • Latest release: Oct 27, 2018
  • Number of updates: 9
  • Update frequency: every 118.7 days
  • Top authors: emtiaz51921 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 1,324 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.16MB] [CPU: ▼154.37ms] Passed 4 tests

This is a short check of server-side resources used by Before After Content
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1337.23 ▲7.62
Dashboard /wp-admin2.98 ▼0.0834.30 ▼14.44
Posts /wp-admin/edit.php3.04 ▼0.0734.68 ▼16.33
Add New Post /wp-admin/post-new.php4.98 ▼0.4683.09 ▼583.05
Media Library /wp-admin/upload.php2.99 ▼0.0230.66 ▼3.64

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Before After Content: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,875 ▼1,69713.25 ▼2.0811.39 ▼0.8959.07 ▲4.87
Dashboard /wp-admin1,119 ▼1,8122.11 ▼3.8147.55 ▼113.4848.91 ▼89.96
Posts /wp-admin/edit.php1,148 ▼1,5911.87 ▼0.8335.27 ▼32.9649.34 ▼54.52
Add New Post /wp-admin/post-new.php609 ▼1,0742.20 ▼16.5619.06 ▼371.0022.64 ▼105.12
Media Library /wp-admin/upload.php961 ▼8462.25 ▼2.7848.84 ▼114.6654.40 ▼76.56

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • recovery_mode_email_last_sent

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/before-after-content/includes/options.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/before-after-content/includes/scripts-enque.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === before-after-content === )
  • Screenshots: Please add images for these screenshots: #1 (After Content Image Example), #2 (After Content Example), #3 (Before Content Image Example), #4 (Before Content Example), #5 (Control Panel Example One), #6 (Control Panel Example Two)
You can look at the official readme.txt

before-after-content/before-after-content.php 92% from 13 tests

The main file in "Before After Content" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 215 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected539 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP76844481
CSS115658

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
6 PNG files occupy 0.89MB with 0.62MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png74.79KB22.81KB▼ 69.50%
screenshot-3.png170.67KB49.94KB▼ 70.74%
screenshot-6.png177.22KB53.72KB▼ 69.69%
screenshot-1.png174.42KB54.67KB▼ 68.66%
screenshot-5.png183.67KB56.35KB▼ 69.32%