10% wp-edit

Code Review | WP Edit

WordPress plugin WP Edit scored 10% from 53 tests.

About plugin

  • Plugin page: wp-edit
  • Plugin version: 4.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.9.8
  • WordPress version: 5.8.1
  • First release: Mar 23, 2014
  • Latest release: Oct 15, 2018
  • Number of updates: 129
  • Update frequency: every 12.9 days
  • Top authors: josh401 (100%)

Code review

53 tests

User reviews

158 reviews

Install metrics

100,000+ active / 1,602,754 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/wp-edit/includes/functions.php+11
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.69MB] [CPU: ▼287.31ms] Passed 4 tests

This is a short check of server-side resources used by WP Edit
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.6638.52 ▲5.20
Dashboard /wp-admin6.00 ▲2.943,689.73 ▲3,641.85
Posts /wp-admin/edit.php3.85 ▲0.7447.31 ▲7.02
Add New Post /wp-admin/post-new.php6.10 ▲0.6795.25 ▼1,156.56
Media Library /wp-admin/upload.php3.68 ▲0.6734.65 ▼4.88

Server storage [IO: ▲0.54MB] [DB: ▲0.25MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 80 new files
Database: no new tables, 6 new options
New WordPress options
wp_edit_extras
wp_edit_global
wp_edit_buttons
wp_edit_general
wp_edit_posts
wp_edit_editor

Browser metrics Passed 4 tests

An overview of browser requirements for WP Edit
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,709 ▲10313.95 ▼1.668.04 ▼0.2248.65 ▲2.34
Dashboard /wp-admin3,124 ▲2715.98 ▼0.01138.23 ▲9.32135.51 ▲35.39
Posts /wp-admin/edit.php2,785 ▲792.69 ▲0.0262.96 ▼6.5085.33 ▼7.89
Add New Post /wp-admin/post-new.php1,906 ▲5319.22 ▲0.10370.89 ▼3.27111.24 ▲6.27
Media Library /wp-admin/upload.php1,851 ▲795.03 ▼0.02140.75 ▼15.79109.39 ▼2.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • wp_edit_general
    • wp_edit_extras
    • wp_edit_buttons
    • wp_edit_posts
    • wp_edit_editor
    • wp_edit_global

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-edit/plugins/advlink/advlink.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-edit/includes/style_formats.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-edit/main.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-edit/includes/functions.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (50 tag instead of maximum 10)
The official readme.txt is a good inspiration

wp-edit/main.php 92% from 13 tests

"WP Edit" version 4.0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-edit.php" instead of "main.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin7,604 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP47425403,855
PO File38308302,029
JavaScript243311441,123
CSS76833575
HTML17722

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 212)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity131.67
▷ Minimum class complexity6.00
▷ Maximum class complexity356.00
Average method complexity7.80
▷ Minimum method complexity1.00
▷ Maximum method complexity212.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods53
▷ Static methods00.00%
▷ Public methods53100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions56
▷ Named functions5598.21%
▷ Anonymous functions11.79%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
19 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugins/custom_plugins/advimage.png3.05KB0.64KB▼ 79.05%
plugins/advlink/images/advlink.png3.02KB0.52KB▼ 82.67%
plugins/custom_plugins/clker.png3.65KB0.98KB▼ 73.14%
images/close_banner.png0.44KB0.49KB0.00%
plugins/custom_plugins/formatPainter.png3.20KB0.63KB▼ 80.36%