10% safe-php-code-widget

Code Review | Safe PHP Code Widget

WordPress plugin Safe PHP Code Widget scored10%from 54 tests.

About plugin

  • Plugin page: safe-php-code-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.0.2
  • WordPress version: 6.3.1
  • First release: Jan 9, 2019
  • Latest release: Jan 9, 2019
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: k0tik (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,541 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/safe-php-code-widget/safe-php-code-widget.php+62
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.34ms] Passed 4 tests

This is a short check of server-side resources used by Safe PHP Code Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.37 ▼38.17
Dashboard /wp-admin2.05 ▼1.266.16 ▼43.82
Posts /wp-admin/edit.php2.05 ▼1.315.05 ▼46.91
Add New Post /wp-admin/post-new.php2.05 ▼3.845.75 ▼88.47
Media Library /wp-admin/upload.php2.05 ▼1.184.26 ▼29.19

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_safephpcode

Browser metrics Passed 4 tests

Checking browser requirements for Safe PHP Code Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.011.70 ▲0.1241.77 ▲1.96
Dashboard /wp-admin2,198 ▲215.57 ▲0.0090.11 ▲1.3441.08 ▲0.87
Posts /wp-admin/edit.php2,097 ▼32.02 ▲0.0739.63 ▼2.0737.46 ▲0.11
Add New Post /wp-admin/post-new.php1,526 ▼223.00 ▼0.11660.11 ▼2.0063.65 ▲8.55
Media Library /wp-admin/upload.php1,397 ▼34.17 ▼0.01106.76 ▲5.5345.48 ▼0.92

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/safe-php-code-widget/safe-php-code-widget.php+62
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_safephpcode
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/safe-php-code-widget/safe-php-code-widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (The widgets screen showing a Safe PHP Code Widget in use.), #2 (The output of the widget on the site.)
Please take inspiration from this readme.txt

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

The entry point to "Safe PHP Code Widget" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin46 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17946

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
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%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png4.45KB2.58KB▼ 42.07%
screenshot-1.png15.84KB6.86KB▼ 56.67%