67% lingapi-for-polylang-and-wpml-wp-translation-tool

Code Review | lingAPI for Polylang & WPML - WP translation tool

WordPress plugin lingAPI for Polylang & WPML - WP translation tool scored67%from 54 tests.

About plugin

  • Plugin page: lingapi-for-polyl...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.9
  • WordPress version: 6.3.1
  • First release: Jan 12, 2022
  • Latest release: Feb 17, 2022
  • Number of updates: 9
  • Update frequency: every 4.6 days
  • Top authors: gkubiszyn (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,616 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.85ms] Passed 4 tests

Analyzing server-side resources used by lingAPI for Polylang & WPML - WP translation tool
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.92 ▼5.62
Dashboard /wp-admin3.33 ▼0.0249.16 ▼15.53
Posts /wp-admin/edit.php3.38 ▲0.0250.88 ▲3.60
Add New Post /wp-admin/post-new.php5.91 ▲0.0387.56 ▼8.58
Media Library /wp-admin/upload.php3.25 ▲0.0236.02 ▼1.68

Server storage [IO: ▲27.12MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
These are issues you should consider
  • Total filesystem usage should be limited to 25MB (currently using 27.12MB)
Filesystem: 1,432 new files
Database: 1 new table, 6 new options
New tables
wp_turbotranslations
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for lingAPI for Polylang & WPML - WP translation tool
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9814.18 ▲0.031.92 ▼0.3644.38 ▼2.08
Dashboard /wp-admin2,225 ▲485.66 ▲0.0288.45 ▲0.4138.12 ▼2.57
Posts /wp-admin/edit.php2,131 ▲312.01 ▼0.0240.85 ▲1.8736.66 ▲3.19
Add New Post /wp-admin/post-new.php1,548 ▲2223.18 ▲0.12627.61 ▲36.2459.28 ▲6.87
Media Library /wp-admin/upload.php1,427 ▲304.18 ▲0.02103.22 ▲2.4247.25 ▲0.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_turbotranslations
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/turbotranslations.php
    • > /wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/intl/Resources/bin/update-data.php
  • 94× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Intl\\Data\\Bundle\\Reader\\BundleReaderInterface' not found in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/intl/Data/Bundle/Reader/BufferedBundleReader.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Intl\\DateFormatter\\DateFormat\\HourTransformer' not found in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/intl/DateFormatter/DateFormat/Hour2401Transformer.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Polyfill\\Intl\\Icu\\DateFormat\\Transformer' not found in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/polyfill-intl-icu/DateFormat/HourTransformer.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Polyfill\\Intl\\Icu\\Exception\\RuntimeException' not found in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/polyfill-intl-icu/Exception/NotImplementedException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Intl\\Data\\Generator\\AbstractDataGenerator' not found in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/intl/Data/Generator/LocaleDataGenerator.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Intl\\Data\\Bundle\\Writer\\BundleWriterInterface' not found in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/intl/Data/Bundle/Writer/PhpBundleWriter.php:21
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/includes/TurboTranslationsWPML.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Polyfill\\Intl\\Icu\\DateFormat\\Transformer' not found in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/polyfill-intl-icu/DateFormat/DayTransformer.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Locale' not found in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/intl/Locale.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Intl\\Data\\Bundle\\Reader\\BundleReaderInterface' not found in wp-content/plugins/lingapi-for-polylang-and-wpml-wp-translation-tool/vendor/symfony/intl/Data/Bundle/Reader/JsonBundleReader.php:24

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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: localization, wpml, translations, translation api, lingapi...

lingapi-for-polylang-and-wpml-wp-translation-tool/turbotranslations.php 77% from 13 tests

The main file in "lingAPI for Polylang & WPML - WP translation tool" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 244 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("lingapi-for-polylang-and-wpml-wp-translation-tool.php" instead of "turbotranslations.php")

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 detected343,882 lines of code in 1,280 files:
LanguageFilesBlank linesComment linesLines of code
JSON1,12800334,581
PHP1381,8895,4088,150
JavaScript402,840946
PO File23086115
Markdown423076
Bourne Again Shell12011
CSS3083

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.45
▷ Minimum class complexity1.00
▷ Maximum class complexity72.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces19
Interfaces7
Traits1
Classes116
▷ Abstract classes1613.79%
▷ Concrete classes10086.21%
▷ Final classes1111.00%
Methods600
▷ Static methods18631.00%
▷ Public methods45876.33%
▷ Protected methods6210.33%
▷ Private methods8013.33%
Functions53
▷ Named functions2649.06%
▷ Anonymous functions2750.94%
Constants273
▷ Global constants41.47%
▷ Class constants26998.53%
▷ Public constants25193.31%

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