89% twentytwenty

Code Review | TwentyTwenty

WordPress plugin TwentyTwenty scored89%from 54 tests.

About plugin

  • Plugin page: twentytwenty
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.0
  • WordPress version: 6.3.1
  • First release: Mar 31, 2014
  • Latest release: Sep 11, 2014
  • Number of updates: 13
  • Update frequency: every 12.7 days
  • Top authors: cs123 (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

7,000+ active /58,245 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.54ms] Passed 4 tests

A check of server-side resources used by TwentyTwenty
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.65 ▲0.17
Dashboard /wp-admin3.34 ▲0.0350.55 ▼3.49
Posts /wp-admin/edit.php3.39 ▲0.0352.34 ▲2.00
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.12 ▼16.02
Media Library /wp-admin/upload.php3.26 ▲0.0332.85 ▼2.83

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for TwentyTwenty
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.042.11 ▲0.2846.44 ▲2.11
Dashboard /wp-admin2,209 ▲214.84 ▼0.07112.56 ▲5.2246.53 ▲4.40
Posts /wp-admin/edit.php2,089 ▼02.13 ▲0.1236.69 ▲0.7936.19 ▲1.19
Add New Post /wp-admin/post-new.php1,514 ▼1417.57 ▼0.67660.22 ▼4.3458.23 ▲2.75
Media Library /wp-admin/upload.php1,391 ▲34.17 ▲0.0495.85 ▼11.5344.76 ▲0.61

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: comparison, twentytwenty, slider, before and after, images...

twentytwenty/twentytwenty.php 92% from 13 tests

The main PHP script in "TwentyTwenty" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin786 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript314597462
CSS1290176
PHP573200148

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods637.50%
▷ Public methods1275.00%
▷ Protected methods00.00%
▷ Private methods425.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 2.18MB with 1.21MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png496.96KB224.10KB▼ 54.91%
assets/banner-772x250.png319.55KB147.62KB▼ 53.80%
assets/screenshot-2.png356.05KB138.85KB▼ 61.00%
assets/banner-1544x500.png1,059.71KB512.06KB▼ 51.68%