84% external-image-replace

Code Review | External image replace

WordPress plugin External image replace scored84%from 54 tests.

About plugin

  • Plugin page: external-image-re...
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.2-5.2.4
  • WordPress version: 6.3.1
  • First release: Jan 22, 2018
  • Latest release: Oct 24, 2019
  • Number of updates: 26
  • Update frequency: every 24.6 days
  • Top authors: muromuro (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

700+ active /6,803 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.01ms] Passed 4 tests

This is a short check of server-side resources used by External image replace
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0245.50 ▲4.92
Dashboard /wp-admin3.31 ▲0.0145.57 ▼3.70
Posts /wp-admin/edit.php3.36 ▲0.0142.23 ▼1.38
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.91 ▼5.67
Media Library /wp-admin/upload.php3.24 ▲0.0133.98 ▲2.71
External image replace /wp-admin/tools.php?page=external_image_replace5.2460.39

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 213 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by External image replace
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.74 ▲0.371.76 ▼0.1141.40 ▲1.52
Dashboard /wp-admin2,213 ▲285.85 ▼0.0099.75 ▲1.0038.73 ▼1.83
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0534.57 ▼3.5030.94 ▼4.19
Add New Post /wp-admin/post-new.php1,537 ▲1723.38 ▲0.24657.33 ▲0.0257.91 ▼1.17
Media Library /wp-admin/upload.php1,395 ▲74.22 ▲0.01100.36 ▼6.1843.78 ▼2.99
External image replace /wp-admin/tools.php?page=external_image_replace7832.0725.7126.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 83× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Compile_Shared_Inheritance' not found in wp-content/plugins/external-image-replace/smarty/sysplugins/smarty_internal_compile_block.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_ParseTree' not found in wp-content/plugins/external-image-replace/smarty/sysplugins/smarty_internal_parsetree_template.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Resource_File' not found in wp-content/plugins/external-image-replace/smarty/sysplugins/smarty_internal_resource_php.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/external-image-replace/smarty/sysplugins/smarty_internal_compile_capture.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Method_CompileAllTemplates' not found in wp-content/plugins/external-image-replace/smarty/sysplugins/smarty_internal_method_compileallconfig.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Compile_Assign' not found in wp-content/plugins/external-image-replace/smarty/sysplugins/smarty_internal_compile_append.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/external-image-replace/smarty/sysplugins/smarty_internal_compile_nocache.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Data' not found in wp-content/plugins/external-image-replace/smarty/sysplugins/smarty_data.php:18
    • > PHP Warning
      require_once(SMARTY_PLUGINS_DIRshared.literal_compiler_param.php): failed to open stream: No such file or directory in wp-content/plugins/external-image-replace/smarty/plugins/modifiercompiler.escape.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Template_Resource_Base' not found in wp-content/plugins/external-image-replace/smarty/sysplugins/smarty_template_cached.php:17

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)
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
3 plugin tags: post, update content, update post

external-image-replace/external-image-replace.php Passed 13 tests

The principal PHP file in "External image replace" v. 1.0.8 is loaded by WordPress automatically on each request
80 characters long description:
Replace the external image in the posted article with the media library at once.

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
Everything looks great! No dangerous files found in this plugin17,663 lines of code in 206 files:
LanguageFilesBlank linesComment linesLines of code
PHP2002,46811,18217,389
Smarty2210184
JavaScript22284
CSS2226

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity15.95
▷ Minimum class complexity1.00
▷ Maximum class complexity165.00
Average method complexity3.93
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes169
▷ Abstract classes127.10%
▷ Concrete classes15792.90%
▷ Final classes00.00%
Methods881
▷ Static methods343.86%
▷ Public methods83895.12%
▷ Protected methods242.72%
▷ Private methods192.16%
Functions65
▷ Named functions6092.31%
▷ Anonymous functions57.69%
Constants166
▷ Global constants84.82%
▷ Class constants15895.18%
▷ Public constants158100.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