84% majestic-before-after-image

Code Review | Majestic Before After Image

WordPress plugin Majestic Before After Image scored84%from 54 tests.

About plugin

  • Plugin page: majestic-before-a...
  • Plugin version: 1.0.10
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.2
  • WordPress version: 6.3.1
  • First release: Sep 8, 2022
  • Latest release: Aug 2, 2023
  • Number of updates: 23
  • Update frequency: every 14.3 days
  • Top authors: wpconcern (65.22%)maneshtimilsina (30.43%)rabmalin (13.04%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,916 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▲0.24ms] Passed 4 tests

Server-side resources used by Majestic Before After Image
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1340.40 ▼0.46
Dashboard /wp-admin3.64 ▲0.3349.95 ▼1.39
Posts /wp-admin/edit.php3.69 ▲0.3348.71 ▲3.77
Add New Post /wp-admin/post-new.php6.17 ▲0.2994.81 ▲0.22
Media Library /wp-admin/upload.php3.50 ▲0.2738.97 ▲2.60

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 39 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Majestic Before After Image
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲11613.23 ▼1.081.73 ▼0.0545.45 ▼2.44
Dashboard /wp-admin2,254 ▲695.81 ▼0.05103.08 ▼13.8342.94 ▼2.60
Posts /wp-admin/edit.php2,129 ▲402.03 ▼0.0237.55 ▲0.9534.79 ▲2.45
Add New Post /wp-admin/post-new.php1,547 ▲2623.36 ▲0.03635.64 ▼2.0251.21 ▼8.90
Media Library /wp-admin/upload.php1,429 ▲384.29 ▲0.0897.88 ▼1.1142.09 ▼2.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 | 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
  • 5× 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/majestic-before-after-image/inc/elementor/elementor.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/majestic-before-after-image/inc/mbai.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/majestic-before-after-image/inc/admin-page/admin-page.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/majestic-before-after-image/inc/elementor/widget.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Nilambar\\Welcome\\add_action() in wp-content/plugins/majestic-before-after-image/vendor/ernilambar/wp-welcome/init.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can take inspiration from this readme.txt

majestic-before-after-image/majestic-before-after-image.php Passed 13 tests

The main PHP script in "Majestic Before After Image" version 1.0.10 is automatically included on every request by WordPress
111 characters long description:
Majestic Before After Image is an Elementor addon to show the comparison of two images with a draggable handle.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin3,580 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP246701,1812,440
JavaScript514382635
CSS3680353
JSON300150
Markdown1102

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity18.81
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes16.25%
Methods139
▷ Static methods3827.34%
▷ Public methods11381.29%
▷ Protected methods139.35%
▷ Private methods139.35%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants15
▷ Global constants1386.67%
▷ Class constants213.33%
▷ Public constants2100.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 were not PNG files found in your plugin