84% php-code-widget

Code Review | PHP Code Widget

WordPress plugin PHP Code Widget scored84%from 54 tests.

About plugin

  • Plugin page: php-code-widget
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.9
  • WordPress version: 6.3.1
  • First release: Mar 20, 2008
  • Latest release: Mar 30, 2022
  • Number of updates: 48
  • Update frequency: every 107.3 days
  • Top authors: Otto42 (100%)

Code review

54 tests

User reviews

61 reviews

Install metrics

100,000+ active /961,670 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.89ms] Passed 4 tests

An overview of server-side resources used by PHP Code Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.19 ▼1.82
Dashboard /wp-admin3.33 ▲0.0243.24 ▼2.81
Posts /wp-admin/edit.php3.38 ▲0.0243.83 ▼6.61
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.49 ▼8.30
Media Library /wp-admin/upload.php3.25 ▲0.0234.39 ▼0.15

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_execphp
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for PHP Code Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.421.66 ▼0.0440.01 ▼2.00
Dashboard /wp-admin2,203 ▲155.80 ▲0.8898.53 ▼17.0838.36 ▼8.52
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0442.14 ▼1.1037.62 ▲1.96
Add New Post /wp-admin/post-new.php1,542 ▲2018.49 ▼4.91605.34 ▼57.0249.85 ▼6.86
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.04105.67 ▲4.9744.74 ▼0.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_execphp
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/php-code-widget/execphp.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: widget, execphp, php

php-code-widget/execphp.php 92% from 13 tests

This is the main PHP file of "PHP Code Widget" version 2.4, 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: It is recommended to name the main PHP file as the plugin slug ("php-code-widget.php" instead of "execphp.php")

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
Everything looks great! No dangerous files found in this plugin49 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17949

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
No PNG files were detected