84% redpen-web-widget

Code Review | Redpen Widget

WordPress plugin Redpen Widget scored84%from 54 tests.

About plugin

  • Plugin page: redpen-web-widget
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 6.3.1
  • First release: Dec 15, 2021
  • Latest release: Mar 25, 2022
  • Number of updates: 28
  • Update frequency: every 3.6 days
  • Top authors: ajmerainfotechinc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,055 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: ▼8.10ms] Passed 4 tests

An overview of server-side resources used by Redpen Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0348.42 ▲8.09
Dashboard /wp-admin3.35 ▲0.0049.60 ▼17.69
Posts /wp-admin/edit.php3.40 ▲0.0448.80 ▼4.60
Add New Post /wp-admin/post-new.php5.95 ▲0.0692.98 ▼14.45
Media Library /wp-admin/upload.php3.27 ▲0.0439.60 ▲4.33

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Redpen Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲4314.74 ▲0.221.80 ▼0.0043.59 ▲2.90
Dashboard /wp-admin2,214 ▲345.67 ▼0.0187.58 ▼1.3286.08 ▲42.46
Posts /wp-admin/edit.php2,119 ▲192.01 ▲0.0136.08 ▼5.0932.68 ▼6.66
Add New Post /wp-admin/post-new.php1,458 ▼6816.28 ▼7.34619.00 ▼75.3352.46 ▲1.76
Media Library /wp-admin/upload.php1,413 ▲134.19 ▲0.0396.54 ▼11.2480.48 ▲30.70

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • redpen_plugin_notice
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
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/redpen-web-widget/redpen-widget.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: visual feedback, screenshot, user feedback, bug-tracking, issue reporting...

redpen-web-widget/redpen-widget.php 92% from 13 tests

The primary PHP file in "Redpen Widget" version 1.1.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("redpen-web-widget.php" instead of "redpen-widget.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
Success! There were no dangerous files found in this plugin584 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS1570346
PHP14544215
JavaScript13023

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ 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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/redpen-logo.png2.52KB2.49KB▼ 1.28%
img/redpen-icon.png0.33KB0.30KB▼ 8.58%
img/fav-icon.png0.34KB0.35KB0.00%