94% localize-remote-images

Code Review | Localize Remote Images

WordPress plugin Localize Remote Images scored 94% from 54 tests.

About plugin

  • Plugin page: localize-remote-i...
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.2-5.2.4
  • WordPress version: 5.9.2
  • First release: Jul 11, 2020
  • Latest release: Jul 11, 2020
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: marketingtemplates (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 218 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼348.85ms] Passed 4 tests

An overview of server-side resources used by Localize Remote Images
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0360.99 ▲4.86
Dashboard /wp-admin3.45 ▲0.0435.29 ▼32.58
Posts /wp-admin/edit.php3.67 ▲0.0338.52 ▼1.46
Add New Post /wp-admin/post-new.php6.91 ▼0.0699.49 ▼1,364.36
Media Library /wp-admin/upload.php3.32 ▲0.0234.17 ▲2.99
External image replace /wp-admin/tools.php?page=external_image_replace5.8639.31

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 213 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Localize Remote Images
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4515.85 ▲0.176.48 ▲0.772.70 ▲0.23
Dashboard /wp-admin2,897 ▲396.10 ▼0.07117.38 ▼14.26159.92 ▼9.53
Posts /wp-admin/edit.php2,693 ▲23.24 ▲0.0191.53 ▼2.15139.38 ▼12.07
Add New Post /wp-admin/post-new.php1,784 ▲3217.07 ▼3.90429.84 ▼31.18162.75 ▲1.21
Media Library /wp-admin/upload.php1,700 ▲25.56 ▲0.05155.04 ▲9.07200.57 ▲13.54
External image replace /wp-admin/tools.php?page=external_image_replace1,0162.4482.10123.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 83× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Data' not found in wp-content/plugins/localize-remote-images/smarty/sysplugins/smarty_data.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Template_Source' not found in wp-content/plugins/localize-remote-images/smarty/sysplugins/smarty_template_config.php:19
    • > PHP Warning
      Use of undefined constant SMARTY_PLUGINS_DIR - assumed 'SMARTY_PLUGINS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/localize-remote-images/smarty/plugins/modifiercompiler.escape.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Template_Resource_Base' not found in wp-content/plugins/localize-remote-images/smarty/sysplugins/smarty_template_cached.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/localize-remote-images/smarty/sysplugins/smarty_internal_compile_private_special_variable.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/localize-remote-images/smarty/sysplugins/smarty_internal_compile_private_print_expression.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/localize-remote-images/smarty/sysplugins/smarty_internal_compile_ldelim.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Compile_Shared_Inheritance' not found in wp-content/plugins/localize-remote-images/smarty/sysplugins/smarty_internal_compile_extends.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_CacheResource' not found in wp-content/plugins/localize-remote-images/smarty/sysplugins/smarty_cacheresource_custom.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/localize-remote-images/smarty/sysplugins/smarty_internal_compile_capture.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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: update content, update post, post

localize-remote-images/localize-remote-images.php Passed 13 tests

The entry point to "Localize Remote Images" version 1.0.9 is a PHP file that has certain tags in its header comment area
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 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected17,689 lines of code in 206 files:
LanguageFilesBlank linesComment linesLines of code
PHP2002,47911,18017,415
Smarty2210184
JavaScript22284
CSS2226

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
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
There are no PNG files in this plugin