83% code-widget

Code Review | Code Widget

WordPress plugin Code Widget scored83%from 54 tests.

About plugin

  • Plugin page: code-widget
  • Plugin version: 1.0.15
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.0
  • WordPress version: 6.3.1
  • First release: Mar 22, 2018
  • Latest release: Jun 11, 2022
  • Number of updates: 38
  • Update frequency: every 40.7 days
  • Top authors: sharaz (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

7,000+ active /50,196 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.89ms] Passed 4 tests

Analyzing server-side resources used by Code Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0840.93 ▲2.88
Dashboard /wp-admin3.39 ▲0.0843.22 ▼3.43
Posts /wp-admin/edit.php3.44 ▲0.0848.91 ▲3.42
Add New Post /wp-admin/post-new.php5.97 ▲0.0880.51 ▼11.81
Media Library /wp-admin/upload.php3.31 ▲0.0833.34 ▲0.80

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
cw_activation_time
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
widget_codewidget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Code Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.081.83 ▲0.1844.03 ▲3.64
Dashboard /wp-admin2,195 ▲155.61 ▼0.0591.46 ▲4.5540.43 ▲1.51
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0238.96 ▲3.2237.00 ▲0.89
Add New Post /wp-admin/post-new.php1,526 ▼523.54 ▲0.38666.24 ▲10.4057.35 ▼1.34
Media Library /wp-admin/upload.php1,400 ▲34.22 ▲0.0192.99 ▼5.1738.96 ▼4.85

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • cw_activation_time
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_codewidget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 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 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 items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function solbox_plugin_feedback\\is_admin() in wp-content/plugins/code-widget/lib/solbox-plugin-deactivation-survey/deactivate-feedback-form.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed: You can take inspiration from this readme.txt

code-widget/class-code-widget.php 77% from 13 tests

The primary PHP file in "Code Widget" version 1.0.15 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("code-widget.php" instead of "class-code-widget.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 209 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected790 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP269144336
CSS310143330
JavaScript23013108
Markdown110016

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods1090.91%
▷ Protected methods00.00%
▷ Private methods19.09%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants4
▷ Global constants4100.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
There were not PNG files found in your plugin