74% code-injection

Code Review | Code Injection

WordPress plugin Code Injection scored74%from 54 tests.

About plugin

  • Plugin page: code-injection
  • Plugin version: 2.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Feb 14, 2019
  • Latest release: Nov 11, 2023
  • Number of updates: 22
  • Update frequency: every 78.7 days
  • Top authors: rmanaf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,317 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.49MB] [CPU: ▲4.14ms] Passed 4 tests

An overview of server-side resources used by Code Injection
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5143.87 ▲6.19
Dashboard /wp-admin3.82 ▲0.5250.87 ▼5.10
Posts /wp-admin/edit.php3.87 ▲0.5154.55 ▲9.48
Add New Post /wp-admin/post-new.php6.37 ▲0.4899.92 ▲8.56
Media Library /wp-admin/upload.php3.68 ▲0.4538.23 ▲6.92
Code Injection /wp-admin/options-general.php?page=ci-general3.6537.33

Server storage [IO: ▲0.16MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 41 new files
Database: 1 new table, 9 new options
New tables
ci_activities
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_wp_code_injection_plugin_widget
theysaidso_admin_options
ci_db_version
widget_recent-comments
ci_role_version

Browser metrics Passed 4 tests

Code Injection: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲9814.08 ▼0.631.95 ▲0.3041.75 ▲0.70
Dashboard /wp-admin2,237 ▲605.61 ▼0.1091.98 ▼10.9842.33 ▼1.85
Posts /wp-admin/edit.php2,139 ▲392.05 ▲0.0739.37 ▲2.6134.91 ▲0.89
Add New Post /wp-admin/post-new.php6,237 ▲4,70821.24 ▼1.90904.50 ▲240.1977.96 ▲23.57
Media Library /wp-admin/upload.php1,445 ▲424.22 ▲0.00101.41 ▲3.9341.77 ▼0.79
Code Injection /wp-admin/options-general.php?page=ci-general9252.1928.4835.65

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 50% 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 1 table in the database
    • ci_activities
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • ci_role_version
    • widget_theysaidso_widget
    • ci_db_version
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_wp_code_injection_plugin_widget
    • widget_recent-posts
    • theysaidso_admin_options

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 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
The following issues need your attention
  • 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/code-injection/includes/class-widget.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: code, snippets, injection

code-injection/code-injection.php 92% from 13 tests

The main PHP script in "Code Injection" version 2.5.0 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 222 characters long)

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
No dangerous file extensions were detected2,814 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP168358331,609
CSS31047571
JavaScript611830345
SVG8100140
PO File16169135
Markdown111014

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity15.85
▷ Minimum class complexity3.00
▷ Maximum class complexity44.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes1292.31%
Methods82
▷ Static methods4048.78%
▷ Public methods7085.37%
▷ Protected methods00.00%
▷ Private methods1214.63%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants9
▷ Global constants444.44%
▷ Class constants555.56%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin