84% localize-js

Code Review | Localize js

WordPress plugin Localize js scored84%from 54 tests.

About plugin

  • Plugin page: localize-js
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.01
  • WordPress version: 6.3.1
  • First release: Dec 11, 2014
  • Latest release: Dec 11, 2014
  • Number of updates: 4
  • Update frequency: every 2.0 days
  • Top authors: kamiel79 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /747 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.03MB] [CPU: ▼15.00ms] Passed 4 tests

Server-side resources used by Localize js
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0822.53 ▼20.05
Dashboard /wp-admin3.31 ▼0.0446.85 ▼19.42
Posts /wp-admin/edit.php3.36 ▲0.0049.01 ▲0.91
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.88 ▼18.47
Media Library /wp-admin/upload.php3.23 ▲0.0037.37 ▼2.07

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Localize js
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5713.71 ▼0.931.88 ▲0.1443.09 ▲2.78
Dashboard /wp-admin2,224 ▲215.88 ▲1.01111.64 ▲5.0241.98 ▼2.75
Posts /wp-admin/edit.php2,103 ▲32.01 ▼0.0336.86 ▼1.1329.59 ▼3.08
Add New Post /wp-admin/post-new.php1,526 ▼517.71 ▼5.57696.74 ▲61.2953.13 ▼5.63
Media Library /wp-admin/upload.php1,400 ▼04.25 ▲0.0195.51 ▼8.8044.06 ▼0.21

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/localize-js/localize-js.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: javascript, multilingual, po, l10n, i18n...

localize-js/localize-js.php Passed 13 tests

"Localize js" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
53 characters long description:
Make the _e() function available in javascript files.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected30 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP181330

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin