67% itzultzailea

Code Review | Elia

WordPress plugin Elia scored67%from 54 tests.

About plugin

  • Plugin page: itzultzailea
  • Plugin version: 1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.2
  • WordPress version: 6.3.1
  • First release: May 24, 2021
  • Latest release: Nov 9, 2022
  • Number of updates: 15
  • Update frequency: every 40.7 days
  • Top authors: elhuyar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /539 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲11.38MB] [CPU: ▲117.69ms] 50% from 4 tests

An overview of server-side resources used by Elia
It is recommended to improve the following
  • RAM: Total memory usage should be kept under 10MB (currently 16.72MB on /wp-admin/admin.php?page=itzultzailea/menu/support.php)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 11.38MB on /wp-admin/admin.php?page=itzultzailea/menu/support.php)
PageMemory (MB)CPU Time (ms)
Home /11.43 ▲7.97125.92 ▲83.28
Dashboard /wp-admin16.59 ▲13.29180.60 ▲116.02
Posts /wp-admin/edit.php16.51 ▲13.15200.91 ▲151.70
Add New Post /wp-admin/post-new.php17.02 ▲11.14296.10 ▲199.07
Media Library /wp-admin/upload.php16.50 ▲13.27155.99 ▲119.77
Troubleshooting /wp-admin/admin.php?page=itzultzailea/menu/troubleshooting.php13.46140.24
Debug information /wp-admin/admin.php?page=itzultzailea/menu/debug-information.php16.49400.27
Setup /wp-admin/admin.php?page=itzultzailea/menu/setup.php16.49184.62
Installer Support /wp-admin/admin.php?page=otgs-installer-support16.71146.14
Support /wp-admin/admin.php?page=itzultzailea/menu/support.php16.72186.29

Server storage [IO: ▲31.73MB] [DB: ▲0.38MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • Filesystem usage must be lower than 25MB (currently using 31.73MB)
Filesystem: 4,126 new files
Database: 18 new tables, 18 new options
New tables
wp_icl_flags
wp_icl_translate
wp_icl_translation_batches
wp_icl_translate_job
wp_icl_core_status
wp_icl_message_status
wp_icl_node
wp_icl_locale_map
wp_icl_string_translations
wp_icl_strings
...
New WordPress options
WPML_Group_Keys
icl_sitepress_settings
wpml_dependencies:installed_plugins
theysaidso_admin_options
wpml_dependencies:valid_plugins
wpml_dependencies:invalid_plugins
widget_recent-posts
widget_theysaidso_widget
wpml_language_switcher
wpml_language_switcher_template_objects
...

Browser metrics Passed 4 tests

An overview of browser requirements for Elia
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲13914.07 ▼0.553.04 ▲1.1438.93 ▼4.81
Dashboard /wp-admin2,275 ▲875.54 ▲0.49122.10 ▲12.50101.28 ▲57.89
Posts /wp-admin/edit.php2,217 ▲1252.48 ▲0.4665.75 ▲27.3666.25 ▲25.80
Add New Post /wp-admin/post-new.php1,622 ▲10321.22 ▼1.86751.12 ▲83.44114.65 ▲57.59
Media Library /wp-admin/upload.php1,468 ▲834.75 ▲0.57113.72 ▲10.8181.83 ▲38.89
Troubleshooting /wp-admin/admin.php?page=itzultzailea/menu/troubleshooting.php9692.4836.3836.06
Debug information /wp-admin/admin.php?page=itzultzailea/menu/debug-information.php8762.2335.7529.33
Setup /wp-admin/admin.php?page=itzultzailea/menu/setup.php1,2037.98184.5277.45
Installer Support /wp-admin/admin.php?page=otgs-installer-support1,0962.2535.0234.01
Support /wp-admin/admin.php?page=itzultzailea/menu/support.php1,1862.2536.5638.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 18 tables in the database
    • wp_icl_string_positions
    • wp_icl_languages_translations
    • wp_icl_translation_status
    • wp_icl_translate
    • wp_icl_reminders
    • wp_icl_translation_batches
    • wp_icl_translate_job
    • wp_icl_flags
    • wp_icl_node
    • wp_icl_message_status
    • ...
  • Zombie WordPress options were found after uninstall: 17 options
    • widget_recent-posts
    • icl_sitepress_version
    • wpml_language_switcher
    • WPML_Group_Keys
    • wpml_dependencies:valid_plugins
    • wpml_dependencies:expected_versions
    • wpml_dependencies:installed_plugins
    • widget_theysaidso_widget
    • icl_sitepress_settings
    • WPML(setup)
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/itzultzailea/sitepress.php
  • 1337× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPML_Name_Query_Filter' not found in wp-content/plugins/itzultzailea/inc/query-filtering/wpml-name-query-filter-translated.class.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPML\\TranslationRoles\\Remove' not found in wp-content/plugins/itzultzailea/classes/translation-roles/endpoints/RemoveManager.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/itzultzailea/inc/upgrade-functions/upgrade-2.0.0.php:252
    • > PHP Fatal error
      Uncaught Error: Class 'WPML\\Core\\Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/itzultzailea/lib/twig/src/TokenParser/DeprecatedTokenParser.php:25
    • > PHP Warning
      Use of undefined constant WPML_TM_PATH - assumed 'WPML_TM_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/itzultzailea/inc/translation-jobs/jobs/wpml-element-translation-job.class.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WPML_Elementor_Media_Node' not found in wp-content/plugins/itzultzailea/addons/wpml-page-builders/classes/Integrations/Elementor/media/modules/VideoPlaylist.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'IWPML_Backend_Action_Loader' not found in wp-content/plugins/itzultzailea/classes/privacy/class-wpml-tm-privacy-content-factory.php:6
    • > PHP Warning
      require(wp-content/plugins/itzultzailea/vendor/otgs/auryn/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/itzultzailea/vendor/otgs/auryn/examples/delegate_params.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WPML_SP_User' not found in wp-content/plugins/itzultzailea/classes/menu/translation-editor/class-wpml-translation-editor-languages.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/itzultzailea/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Setup configuration: Elia's credentials and language configuration screenshot1.(png).), #2 (Translate a post to diferent languages screenshot2. (png).), #3 (Translate the post to the selected language with machine translation screenshot3.(png).)
Please take inspiration from this readme.txt

itzultzailea/sitepress.php 85% from 13 tests

The primary PHP file in "Elia" version 1.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 346 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("itzultzailea.php" instead of "sitepress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin310,478 lines of code in 3,458 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,56935,03652,281180,084
JavaScript1773,9441,61770,994
JSON3330032,882
PO File868,21412,65014,404
Markdown122,50203,481
Twig12943913,438
CSS73347222,660
SVG38101,242
HTML33390677
XSD14433336
XML515192191
make2471889

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity621.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces200
Interfaces97
Traits6
Classes2,328
▷ Abstract classes1104.73%
▷ Concrete classes2,21895.27%
▷ Final classes60.27%
Methods11,545
▷ Static methods1,28511.13%
▷ Public methods8,36772.47%
▷ Protected methods6966.03%
▷ Private methods2,48221.50%
Functions1,103
▷ Named functions48844.24%
▷ Anonymous functions61555.76%
Constants1,305
▷ Global constants20515.71%
▷ Class constants1,10084.29%
▷ Public constants1,100100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
391 PNG files occupy 0.88MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
res/flags/gn.png0.24KB0.21KB▼ 12.90%
res/flags/tj.png0.33KB0.31KB▼ 6.73%
res/flags/na.png0.57KB0.47KB▼ 17.59%
res/img/recommendations/gravityforms.png4.81KB2.14KB▼ 55.49%
res/flags/bd.png0.37KB0.30KB▼ 19.15%