84% wp-file-get-contents

Code Review | JSM file_get_contents() Shortcode

WordPress plugin JSM file_get_contents() Shortcode scored84%from 54 tests.

About plugin

  • Plugin page: wp-file-get-contents
  • Plugin version: 2.7.0
  • PHP compatiblity: 7.2.34+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 22, 2014
  • Latest release: Aug 29, 2023
  • Number of updates: 587
  • Update frequency: every 5.7 days
  • Top authors: jsmoriss (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /9,454 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.08ms] Passed 4 tests

Analyzing server-side resources used by JSM file_get_contents() Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0448.67 ▲8.20
Dashboard /wp-admin3.35 ▲0.0046.03 ▼13.57
Posts /wp-admin/edit.php3.40 ▲0.0447.67 ▲1.15
Add New Post /wp-admin/post-new.php5.93 ▲0.0497.35 ▼7.30
Media Library /wp-admin/upload.php3.27 ▲0.0435.28 ▼0.59

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

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

Browser metrics Passed 4 tests

A check of browser resources used by JSM file_get_contents() Shortcode
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.391.85 ▲0.3042.49 ▲3.06
Dashboard /wp-admin2,203 ▲145.83 ▼0.0594.77 ▼5.8938.87 ▼2.99
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0240.21 ▲2.1734.11 ▲1.89
Add New Post /wp-admin/post-new.php1,533 ▼923.29 ▲5.08631.02 ▼34.3559.04 ▲0.57
Media Library /wp-admin/upload.php1,388 ▲34.22 ▲0.0495.47 ▼6.5041.98 ▼3.91

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: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • 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 everything seems fine, this is not 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 output text when accessed directly:
    • > /wp-content/plugins/wp-file-get-contents/wp-file-get-contents.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: url, body, include, content, file_get_contents...

wp-file-get-contents/wp-file-get-contents.php Passed 13 tests

This is the main PHP file of "JSM file_get_contents() Shortcode" version 2.7.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
51 characters long description:
A WordPress shortcode for PHP's file_get_contents()

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 detected228 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP110464177
Markdown116051

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.82
Average class complexity69.00
▷ Minimum class complexity69.00
▷ Maximum class complexity69.00
Average method complexity7.80
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods218.18%
▷ Public methods872.73%
▷ Protected methods00.00%
▷ Private methods327.27%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin