84% nicen-localize-image

Code Review | nicen-localize-image

WordPress plugin nicen-localize-image scored84%from 54 tests.

About plugin

  • Plugin page: nicen-localize-image
  • Plugin version: 1.4.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 9, 2022
  • Latest release: Aug 3, 2023
  • Number of updates: 16
  • Update frequency: every 20.6 days
  • Top authors: nicen174 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active /5,642 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.35MB] [CPU: ▼10.32ms] Passed 4 tests

Analyzing server-side resources used by nicen-localize-image
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2141.60 ▼1.63
Dashboard /wp-admin3.60 ▲0.2552.49 ▼12.18
Posts /wp-admin/edit.php3.72 ▲0.3653.27 ▲2.71
Add New Post /wp-admin/post-new.php3.75 ▼2.1473.93 ▼30.17
Media Library /wp-admin/upload.php3.53 ▲0.2946.22 ▲5.01

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 32 new options
New WordPress options
nicen_make_plugin_local
nicen_make_plugin_private
nicen_make_plugin_interval
nicen_make_save_as_thumb
nicen_make_plugin_path
widget_theysaidso_widget
nicen_make_publish_white
db_upgraded
nicen_make_plugin_add_thumb
nicen_make_plugin_alt_type
...

Browser metrics Passed 4 tests

A check of browser resources used by nicen-localize-image
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.31 ▼0.871.74 ▼0.1542.33 ▲0.21
Dashboard /wp-admin2,222 ▲345.89 ▲0.88108.49 ▲2.9343.65 ▼3.05
Posts /wp-admin/edit.php2,108 ▲162.01 ▼0.0037.46 ▼1.7839.30 ▼0.50
Add New Post /wp-admin/post-new.php3,196 ▲1,6747.86 ▼15.66188.99 ▼487.6080.51 ▲19.74
Media Library /wp-admin/upload.php1,407 ▲164.31 ▲0.10100.44 ▼16.2249.36 ▲0.08

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 32 options
    • nicen_make_plugin_save_result
    • nicen_make_save_as_thumb
    • nicen_make_plugin_add_thumb
    • nicen_make_plugin_alt_type
    • nicen_make_publish_time_start
    • nicen_make_plugin_record_log
    • nicen_make_plugin_add_domain
    • can_compress_scripts
    • nicen_make_publish_white
    • nicen_make_plugin_private
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/nicen-localize-image/class/crontab.php:28
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/nicen-localize-image/admin/common.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nicen-localize-image/admin/setting.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function nicen_getAutoInfo() in wp-content/plugins/nicen-localize-image/config.php:147
    • > PHP Warning
      Use of undefined constant nicen_make_CONFIG - assumed 'nicen_make_CONFIG' (this will throw an Error in a future version of PHP) in wp-content/plugins/nicen-localize-image/admin/install.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function nicen\\local\\images\\plugin_dir_path() in wp-content/plugins/nicen-localize-image/nicen-localize-image.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nicen-localize-image/admin/when-post.php:191
    • > PHP Warning
      Use of undefined constant nicen_make_CONFIG - assumed 'nicen_make_CONFIG' (this will throw an Error in a future version of PHP) in wp-content/plugins/nicen-localize-image/admin/common.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/nicen-localize-image/admin/preload.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/nicen-localize-image/response/response.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: No valid plugin tags found
You can take inspiration from this readme.txt

nicen-localize-image/nicen-localize-image.php 92% from 13 tests

The main PHP file in "nicen-localize-image" ver. 1.4.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 210 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin8,167 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript79616926,054
PHP165867191,729
Sass1390138
CSS1241128
Markdown1470103
SVG10015

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity19.80
▷ Minimum class complexity4.00
▷ Maximum class complexity32.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods30
▷ Static methods516.67%
▷ Public methods2583.33%
▷ Protected methods00.00%
▷ Private methods516.67%
Functions36
▷ Named functions3288.89%
▷ Anonymous functions411.11%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.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
There were not PNG files found in your plugin