93% 2em

Code Review | 2em

WordPress plugin 2em scored 93% 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: 5.9.2
  • 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

400+ active / 2,940 total downloads


Plugin footprint Passed 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.01MB] [CPU: ▼299.91ms] Passed 4 tests

Analyzing server-side resources used by 2em
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0153.54 ▲1.59
Dashboard /wp-admin3.42 ▲0.0132.36 ▼11.45
Posts /wp-admin/edit.php3.65 ▲0.0136.59 ▼0.20
Add New Post /wp-admin/post-new.php6.90 ▼0.0794.54 ▼1,180.57
Media Library /wp-admin/upload.php3.30 ▲0.0022.42 ▼7.41

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for 2em
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲3115.97 ▼0.065.59 ▼0.332.47 ▲0.31
Dashboard /wp-admin2,888 ▲306.13 ▲0.07118.91 ▼17.20156.34 ▼8.05
Posts /wp-admin/edit.php2,694 ▲103.25 ▲0.0163.63 ▼1.52142.30 ▲3.04
Add New Post /wp-admin/post-new.php1,676 ▼7619.31 ▼2.23438.43 ▼1.54151.11 ▼9.51
Media Library /wp-admin/upload.php1,698 ▼35.54 ▲0.02141.70 ▼4.44190.44 ▼4.05

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > 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 smoke test targeting browser errors/issues
Everything seems fine on the user side


Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3 in 2em/assets to your readme.txt
  • Plugin Name: Please specify the plugin name on the first line ( === 2em === )
You can look at the official readme.txt

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

This is the main PHP file of "2em" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to 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 review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected76 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions4100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings