72% translation-pro

Code Review | Translation.Pro

WordPress plugin Translation.Pro scored72%from 54 tests.

About plugin

  • Plugin page: translation-pro
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1
  • WordPress version: 6.3.1
  • First release: Dec 27, 2018
  • Latest release: Feb 22, 2019
  • Number of updates: 7
  • Update frequency: every 8.7 days
  • Top authors: contentlocalized (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /690 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼5.30ms] Passed 4 tests

This is a short check of server-side resources used by Translation.Pro
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1639.23 ▼1.32
Dashboard /wp-admin3.47 ▲0.1254.67 ▼7.91
Posts /wp-admin/edit.php3.59 ▲0.2349.15 ▼2.51
Add New Post /wp-admin/post-new.php6.07 ▲0.1891.56 ▼9.47
Media Library /wp-admin/upload.php3.40 ▲0.1644.81 ▲6.60
Dashboard /wp-admin/admin.php?page=cltp3.3431.45
Settings /wp-admin/admin.php?page=cltp&action=settings3.3835.99
New Translation /wp-admin/admin.php?page=cltp&action=new_translation3.3437.45

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 329 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Translation.Pro: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8114.77 ▲0.391.81 ▲0.1044.83 ▲2.30
Dashboard /wp-admin2,218 ▲384.92 ▼0.7895.40 ▲9.6582.22 ▲37.59
Posts /wp-admin/edit.php2,137 ▲372.30 ▲0.2832.30 ▼7.0134.96 ▼1.83
Add New Post /wp-admin/post-new.php1,712 ▲17222.37 ▼0.90710.46 ▲8.3330.21 ▼37.41
Media Library /wp-admin/upload.php1,429 ▲294.39 ▲0.14108.94 ▲0.6680.06 ▲32.50
Dashboard /wp-admin/admin.php?page=cltp1,5972.8430.5647.11
Settings /wp-admin/admin.php?page=cltp&action=settings9251.8727.0034.40
New Translation /wp-admin/admin.php?page=cltp&action=new_translation1,5972.6832.6440.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=cltp
    • > Notice in wp-content/plugins/translation-pro/includes/admin/translation-pro-admin-pages-trait.php+17
    Undefined index: action
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cltp&action=new_translation
    • > User deprecated in wp-includes/class-requests.php+24
    The PSR-0 `Requests_...` class names in the Requests library are deprecated. Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/translation-pro/admin/partials/view_article.php
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/translation-pro/admin/partials/settings.php:11
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/translation-pro/admin/partials/view_article.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/translation-pro/admin/partials/new_translation.php:2
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/translation-pro/admin/partials/view_article.php on line 62
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/translation-pro/includes/admin/class-translation-pro-article-list.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/translation-pro/admin/partials/dashboard.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/translation-pro/admin/partials/view_article.php on line 2
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/translation-pro/admin/partials/view_article.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Contentlocalized\\ContentlocalizedAPI' not found in wp-content/plugins/translation-pro/admin/partials/balance.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/translation-pro/admin/partials/view_article.php on line 62

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Donate link: Invalid URI ("https:/contentlocalized.com")
The official readme.txt might help

translation-pro/translation-pro.php 92% from 13 tests

Analyzing the main PHP file in "Translation.Pro" version 1.0.0
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected2,125 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS21876997
PHP16228533944
JavaScript2414184

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.75
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces1
Interfaces0
Traits1
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods52
▷ Static methods1426.92%
▷ Public methods4484.62%
▷ Protected methods00.00%
▷ Private methods815.38%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants2
▷ Global constants2100.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
304 PNG files occupy 0.27MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/flags_iso/16/gq.png0.52KB0.53KB0.00%
admin/img/flags_iso/16/cd.png0.61KB0.71KB0.00%
admin/img/flags_iso/16/om.png0.44KB0.46KB0.00%
admin/img/flags_iso/16/cx.png3.95KB0.62KB▼ 84.36%
admin/img/flags_iso/16/lr.png0.45KB0.40KB▼ 10.07%