89% wp-imgur-plus

Code Review | WP Imgur Plus

WordPress plugin WP Imgur Plus scored 89% from 54 tests.

About plugin

  • Plugin page: wp-imgur-plus
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Aug 6, 2015
  • Latest release: Nov 5, 2015
  • Number of updates: 4
  • Update frequency: every 22.8 days
  • Top authors: skalero01 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,220 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.68MB] [CPU: ▼143.84ms] Passed 4 tests

An overview of server-side resources used by WP Imgur Plus
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.36 ▲0.6449.00 ▲25.50
Dashboard /wp-admin3.81 ▲0.7551.62 ▲3.41
Posts /wp-admin/edit.php3.86 ▲0.7555.22 ▲7.21
Add New Post /wp-admin/post-new.php6.10 ▲0.6699.30 ▼586.55
Media Library /wp-admin/upload.php3.69 ▲0.6938.14 ▲0.59
WP Imgur Plus /wp-admin/options-general.php?page=wp-imgur-plus3.7036.76

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 331 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WP Imgur Plus: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.82 ▲0.258.98 ▼0.2449.62 ▲1.69
Dashboard /wp-admin2,975 ▲416.02 ▲0.08144.31 ▼5.42101.98 ▼24.23
Posts /wp-admin/edit.php2,744 ▲52.68 ▲0.0165.53 ▼7.1591.41 ▼4.39
Add New Post /wp-admin/post-new.php1,686 ▲318.66 ▲0.01410.32 ▲10.48110.88 ▼1.46
Media Library /wp-admin/upload.php1,815 ▲85.02 ▲0.00152.21 ▼15.70118.31 ▼3.36
WP Imgur Plus /wp-admin/options-general.php?page=wp-imgur-plus1,0363.5990.3973.27

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 184× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Arrow\\Plugin' not found in wp-content/plugins/wp-imgur-plus/lib/WpImgur/Plugin.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/wp-imgur-plus/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Function' not found in wp-content/plugins/wp-imgur-plus/vendor/twig/twig/lib/Twig/Function/Node.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extension' not found in wp-content/plugins/wp-imgur-plus/vendor/twig/twig/lib/Twig/Extension/Optimizer.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/wp-imgur-plus/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/wp-imgur-plus/vendor/twig/twig/lib/Twig/Node/Block.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/wp-imgur-plus/vendor/rmccue/requests/library/Requests/Exception/HTTP/406.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/wp-imgur-plus/vendor/twig/twig/lib/Twig/Node/Import.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/wp-imgur-plus/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Function' not found in wp-content/plugins/wp-imgur-plus/vendor/twig/twig/lib/Twig/Function/Method.php:21

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=wp-imgur-plus
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-imgur-plus/js/wp-imgur-plus-vendor.js?ver=1637252664 2914:4 Uncaught Ember.Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1
    • > GET request to /wp-admin/options-general.php?page=wp-imgur-plus
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-imgur-plus/js/wp-imgur-plus-vendor.js?ver=1637252664 41:12 Uncaught Error: Could not find module ember

Optimizations

Plugin configuration Passed 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: cdn, imgur, image cdn

wp-imgur-plus/wp-imgur-plus.php Passed 13 tests

The primary PHP file in "WP Imgur Plus" version 1.0.1 is used by WordPress to initiate all plugin functionality
130 characters long description:
Serves your Media Library from imgur.com, changes the library to Imgur and save space in the hard drive! Based in WP Imgur plugin.

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
There were no executable files found in this plugin39,092 lines of code in 314 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript510,25218,27323,215
PHP2953,6167,80015,194
JSON100349
CSS2450174
YAML9323126
Markdown17024
HTML10010

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity7.44
▷ Minimum class complexity1.00
▷ Maximum class complexity193.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces14
Interfaces24
Traits0
Classes267
▷ Abstract classes103.75%
▷ Concrete classes25796.25%
▷ Final classes00.00%
Methods1,477
▷ Static methods634.27%
▷ Public methods1,33090.05%
▷ Protected methods1439.68%
▷ Private methods40.27%
Functions53
▷ Named functions5298.11%
▷ Anonymous functions11.89%
Constants53
▷ Global constants11.89%
▷ Class constants5298.11%
▷ Public constants52100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/detector.png3.91KB2.31KB▼ 40.91%