10% wp-redditjs

Code Review | Reddit Embed

WordPress plugin Reddit Embed scored 10% from 53 tests.

About plugin

  • Plugin page: wp-redditjs
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.1-3.9.1
  • WordPress version: 5.8.1
  • First release: Jun 4, 2014
  • Latest release: Jul 10, 2014
  • Number of updates: 22
  • Update frequency: every 1.7 days
  • Top authors: benjiballin (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

50+ active / 1,935 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-redditjs/widget.php+178
    Function create_function() is deprecated

Server metrics [RAM: ▼1.89MB] [CPU: ▼323.06ms] Passed 4 tests

This is a short check of server-side resources used by Reddit Embed
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.74 ▼0.984.83 ▼15.70
Dashboard /wp-admin1.76 ▼1.298.79 ▼35.65
Posts /wp-admin/edit.php1.76 ▼1.345.68 ▼37.76
Add New Post /wp-admin/post-new.php1.76 ▼3.675.38 ▼1,184.63
Media Library /wp-admin/upload.php1.76 ▼1.245.31 ▼34.20
wp-redditJS /wp-admin/options-general.php?page=wp-redditjs1.765.45

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 1 new option
New WordPress options
widget_redditjs_sidebar

Browser metrics Passed 4 tests

This is an overview of browser requirements for Reddit Embed
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,787 ▲20516.23 ▲0.7412.31 ▲4.7446.85 ▲4.57
Dashboard /wp-admin2,935 ▲855.91 ▲0.06144.96 ▲14.1198.78 ▼7.49
Posts /wp-admin/edit.php2,711 ▲52.69 ▲0.0066.87 ▲0.4990.60 ▼0.26
Add New Post /wp-admin/post-new.php1,484 ▼36718.43 ▲0.72344.85 ▼8.04106.77 ▲1.11
Media Library /wp-admin/upload.php1,777 ▲24.98 ▼0.02156.69 ▲10.09111.57 ▼7.09
wp-redditJS /wp-admin/options-general.php?page=wp-redditjs1,1622.3455.6051.01

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
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wp-redditjs/widget.php+178
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_redditjs_sidebar

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=wp-redditjs
    • > Deprecated in wp-content/plugins/wp-redditjs/widget.php+178
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=wp-redditjs
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in redditjs_sidebar is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=wp-redditjs
    • > Notice in wp-content/plugins/wp-redditjs/admin/views/admin.php+21
    Undefined index: hiddenConfirmPost

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-redditjs/public/views/public.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-redditjs/widget.php:3
    • > PHP Notice
      Undefined index: hiddenConfirmPost in wp-content/plugins/wp-redditjs/admin/views/admin.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-redditjs/admin/views/admin.php:41

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

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
1 plugin tags: comments

wp-redditjs/wp-redditjs.php Passed 13 tests

The principal PHP file in "Reddit Embed" v. 1.0.0 is loaded by WordPress automatically on each request
11 characters long description:
wp-redditjs

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected563 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP8200477447
CSS2221982
Markdown112024
JavaScript2182810

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity14.00
▷ Minimum class complexity6.00
▷ Maximum class complexity21.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods28
▷ Static methods725.00%
▷ Public methods2278.57%
▷ Protected methods00.00%
▷ Private methods621.43%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected