83% 2em

Code Review | 2em

WordPress plugin 2em scored83%from 54 tests.

About plugin

  • Plugin page: 2em
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-5.5
  • WordPress version: 6.3.1
  • First release: Feb 28, 2017
  • Latest release: Oct 8, 2020
  • Number of updates: 13
  • Update frequency: every 101.3 days
  • Top authors: hewei0 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,711 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.46ms] Passed 4 tests

A check of server-side resources used by 2em
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.79 ▼3.10
Dashboard /wp-admin3.31 ▲0.0149.45 ▼0.16
Posts /wp-admin/edit.php3.36 ▲0.0047.48 ▼3.72
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.88 ▼2.84
Media Library /wp-admin/upload.php3.23 ▲0.0042.89 ▲5.05

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

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

Browser metrics Passed 4 tests

2em: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5613.58 ▼1.071.92 ▲0.1942.66 ▼0.48
Dashboard /wp-admin2,221 ▲186.04 ▲0.19109.54 ▲3.6339.12 ▼1.91
Posts /wp-admin/edit.php2,097 ▼32.06 ▲0.0739.30 ▲2.1635.03 ▼1.94
Add New Post /wp-admin/post-new.php1,689 ▲13522.39 ▲3.85665.64 ▼2.6467.00 ▲13.68
Media Library /wp-admin/upload.php1,403 ▼04.19 ▼0.06104.02 ▲1.1647.56 ▲4.10

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

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/2em/iw-2em.php:30

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

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
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === 2em === )
  • Screenshots: These screenshots lack descriptions #1, #2, #3 in 2em/assets to your readme.txt
Please take inspiration from this readme.txt

2em/iw-2em.php 92% from 13 tests

The entry point to "2em" version 1.1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("2em.php" instead of "iw-2em.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected76 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript222651
PHP1154421
CSS1003
JSON1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
res/images/iw-2em.png0.09KB0.12KB0.00%