78% theme-translation-for-polylang

Code Review | Theme and plugin translation for Polylang (TTfP)

WordPress plugin Theme and plugin translation for Polylang (TTfP) scored78%from 54 tests.

About plugin

  • Plugin page: theme-translation...
  • Plugin version: 3.4.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.2
  • WordPress version: 6.3.1
  • First release: Feb 3, 2016
  • Latest release: Aug 3, 2023
  • Number of updates: 63
  • Update frequency: every 43.5 days
  • Top authors: marcinkazmierski (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

10,000+ active /164,612 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.49ms] Passed 4 tests

A check of server-side resources used by Theme and plugin translation for Polylang (TTfP)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1239.99 ▼3.43
Dashboard /wp-admin3.42 ▲0.1148.42 ▼5.69
Posts /wp-admin/edit.php3.53 ▲0.1747.79 ▼3.01
Add New Post /wp-admin/post-new.php6.00 ▲0.1194.90 ▼13.81
Media Library /wp-admin/upload.php3.34 ▲0.1139.68 ▲0.65

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Theme and plugin translation for Polylang (TTfP)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.21 ▼1.171.76 ▼0.4436.29 ▼12.68
Dashboard /wp-admin2,209 ▲184.86 ▼0.03108.20 ▼0.0938.52 ▼4.42
Posts /wp-admin/edit.php2,089 ▼02.14 ▲0.1540.20 ▼2.1235.46 ▼0.45
Add New Post /wp-admin/post-new.php1,544 ▲3018.41 ▲0.88604.94 ▲8.6662.40 ▲15.05
Media Library /wp-admin/upload.php1,388 ▲34.16 ▲0.05104.29 ▲10.1845.70 ▲4.72

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 6× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/theme-translation-for-polylang/polylang-theme-translation.php
    • > /wp-content/plugins/theme-translation-for-polylang/theme-translation-for-polylang.php
    • > /wp-content/plugins/theme-translation-for-polylang/Polylang_TT_exporter.php
    • > /wp-content/plugins/theme-translation-for-polylang/polylang-tt-access.php
    • > /wp-content/plugins/theme-translation-for-polylang/Polylang_TT_theme.php
    • > /wp-content/plugins/theme-translation-for-polylang/Polylang_TT_importer.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/theme-translation-for-polylang/theme/admin-import-export-page.tpl.php:38
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/theme-translation-for-polylang/theme/admin-import-export-page.tpl.php on line 2
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/theme-translation-for-polylang/theme/admin-import-export-page.tpl.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

theme-translation-for-polylang/polylang-theme-translation.php 92% from 13 tests

The main PHP file in "Theme and plugin translation for Polylang (TTfP)" ver. 3.4.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("theme-translation-for-polylang.php" instead of "polylang-theme-translation.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin944 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP11121160837
PO File13927107

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity12.43
▷ Minimum class complexity3.00
▷ Maximum class complexity25.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods310.71%
▷ Public methods2175.00%
▷ Protected methods517.86%
▷ Private methods27.14%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin