77% twenty20

Code Review | Twenty20 Image Before-After

WordPress plugin Twenty20 Image Before-After scored77%from 54 tests.

About plugin

  • Plugin page: twenty20
  • Plugin version: 1.6.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.1
  • WordPress version: 6.3.1
  • First release: Apr 28, 2016
  • Latest release: Mar 23, 2023
  • Number of updates: 43
  • Update frequency: every 58.6 days
  • Top authors: zayedbaloch (100%)

Code review

54 tests

User reviews

54 reviews

Install metrics

30,000+ active /235,815 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.38ms] Passed 4 tests

An overview of server-side resources used by Twenty20 Image Before-After
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.94 ▼2.26
Dashboard /wp-admin3.32 ▲0.0251.24 ▼3.44
Posts /wp-admin/edit.php3.37 ▲0.0249.65 ▼1.09
Add New Post /wp-admin/post-new.php5.90 ▲0.0299.91 ▲7.65
Media Library /wp-admin/upload.php3.25 ▲0.0241.98 ▼6.73

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_t20_slider_widget
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Twenty20 Image Before-After
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,288 ▲54213.62 ▼0.825.88 ▲3.6341.66 ▼8.12
Dashboard /wp-admin2,612 ▲4274.85 ▼1.00111.69 ▲2.7644.06 ▲0.80
Posts /wp-admin/edit.php2,495 ▲4062.02 ▼0.1439.53 ▲1.9534.17 ▼3.29
Add New Post /wp-admin/post-new.php1,923 ▲55223.29 ▲6.78638.96 ▲56.1865.27 ▲14.29
Media Library /wp-admin/upload.php1,792 ▲4044.16 ▼0.00104.86 ▲1.5945.54 ▲3.03

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_t20_slider_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/twenty20/ttwenty.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/twenty20/inc/elementor/twenty20-elementor.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twenty20/inc/enqueue.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twenty20/inc/for-flatsome-ux-builder.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/twenty20/inc/widget-twenty20.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/twenty20/inc/twenty20-shortcode.php:110
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twenty20/inc/twenty20-shortcode-vc.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: You are using too many tags: 20 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Add Twenty20 before-after image.), #2 (Select any two images fro Media libray.), #3 (Twenty20 Shortcode setting page.), #4 (Shortcod.), #5 (Twenty20 in action.), #6 (Multiple slider in different direction.), #7 (Twenty20 Widgest.), #8 (Widget in action.), #9 (WP Bakery Visual Composer settings.), #10 (Elementor element.), #11 (UX Builder element.)
The official readme.txt might help

twenty20/ttwenty.php 92% from 13 tests

The main file in "Twenty20 Image Before-After" v. 1.6.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("twenty20.php" instead of "ttwenty.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin1,096 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP813735836
CSS2300204
JavaScript49253
HTML1203

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity9.75
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods21
▷ Static methods14.76%
▷ Public methods1885.71%
▷ Protected methods314.29%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 PNG files occupy 0.80MB with 0.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-9.png109.82KB46.97KB▼ 57.23%
screenshot-8.png70.59KB35.67KB▼ 49.47%
screenshot-1.png42.09KB14.55KB▼ 65.43%
screenshot-11.png74.06KB28.11KB▼ 62.05%
assets/images/twenty20.png2.74KB1.39KB▼ 49.21%