74% slug-translater

Code Review | SLUG TRANSLATER

WordPress plugin SLUG TRANSLATER scored74%from 54 tests.

About plugin

  • Plugin page: slug-translater
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.1
  • WordPress version: 6.3.1
  • First release: Feb 25, 2023
  • Latest release: Aug 11, 2023
  • Number of updates: 20
  • Update frequency: every 8.4 days
  • Top authors: itmaroon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /293 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.24MB] [CPU: ▼6.40ms] Passed 4 tests

Analyzing server-side resources used by SLUG TRANSLATER
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2446.79 ▲1.54
Dashboard /wp-admin3.61 ▲0.2656.31 ▼7.51
Posts /wp-admin/edit.php3.66 ▲0.3049.61 ▼9.75
Add New Post /wp-admin/post-new.php6.12 ▲0.2489.77 ▼9.88
Media Library /wp-admin/upload.php3.47 ▲0.2444.56 ▲9.03
SLUG TRANSLATER /wp-admin/options-general.php?page=sl_trans_menu3.4339.62

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 1,250 new files
Database: no new tables, 9 new options
New WordPress options
sl_trans_tax_check
sl_trans_timing_check
widget_recent-comments
db_upgraded
sl_trans_type_check
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by SLUG TRANSLATER
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲6013.59 ▼0.382.24 ▲0.4144.02 ▲2.70
Dashboard /wp-admin2,209 ▲185.79 ▲0.9498.52 ▼3.1236.35 ▼9.08
Posts /wp-admin/edit.php2,095 ▲62.05 ▼0.0134.31 ▼7.1538.01 ▼1.21
Add New Post /wp-admin/post-new.php1,519 ▼217.69 ▼5.71692.74 ▲15.6655.01 ▲2.59
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.02105.79 ▼0.8645.25 ▼2.34
SLUG TRANSLATER /wp-admin/options-general.php?page=sl_trans_menu9942.0822.2628.91

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 609× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/slug-translater/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/slug-translater/vendor/google/common-protos/src/Api/Expr/V1alpha1/Explain.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\\JsonFormatter' not found in wp-content/plugins/slug-translater/vendor/monolog/monolog/src/Monolog/Formatter/LogmaticFormatter.php:21
    • > PHP Fatal error
      Trait 'Google\\Cloud\\Core\\RequestWrapperTrait' not found in wp-content/plugins/slug-translater/vendor/google/cloud-core/src/GrpcRequestWrapper.php on line 35
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/slug-translater/vendor/google/common-protos/src/Api/Expr/V1beta1/Expr/CreateList.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/slug-translater/vendor/google/common-protos/src/Api/Expr/V1alpha1/EvalResponse.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/slug-translater/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/slug-translater/vendor/google/common-protos/src/Api/Billing/BillingDestination.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/slug-translater/vendor/google/cloud-translate/src/V3/BatchTranslateTextRequest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\GroupHandler' not found in wp-content/plugins/slug-translater/vendor/monolog/monolog/src/Monolog/Handler/FallbackGroupHandler.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: post, slug, custom, category, japanese...

slug-translater/slug_translater.php 85% from 13 tests

Analyzing the main PHP file in "SLUG TRANSLATER" version 1.2.0
It is important to fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: The principal plugin file should be the same as the plugin slug ("slug-translater.php" instead of "slug_translater.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/slug-translater/vendor/bin/google-cloud-batch.bat
74,111 lines of code in 1,187 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,09415,14167,61964,739
Markdown462,00705,809
JSON34103,230
PO File13737105
Protocol Buffers2143864
XML30151
YAML313049
CSS11146
Bourne Shell24014
DOS Batch1004

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.27
Average class complexity6.10
▷ Minimum class complexity1.00
▷ Maximum class complexity436.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces152
Interfaces65
Traits66
Classes930
▷ Abstract classes181.94%
▷ Concrete classes91298.06%
▷ Final classes424.61%
Methods6,087
▷ Static methods62010.19%
▷ Public methods5,26586.50%
▷ Protected methods2994.91%
▷ Private methods5238.59%
Functions269
▷ Named functions8933.09%
▷ Anonymous functions18066.91%
Constants555
▷ Global constants101.80%
▷ Class constants54598.20%
▷ Public constants49390.46%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin