84% magic-post-translate

Code Review | Magic Post Translate

WordPress plugin Magic Post Translate scored84%from 54 tests.

About plugin

  • Plugin page: magic-post-translate
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 7, 2020
  • Latest release: Jun 23, 2020
  • Number of updates: 3
  • Update frequency: every 56.3 days
  • Top authors: Mcurly (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,099 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.14MB] [CPU: ▼4.46ms] Passed 4 tests

Analyzing server-side resources used by Magic Post Translate
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0837.74 ▼13.56
Dashboard /wp-admin3.47 ▲0.1650.19 ▼0.66
Posts /wp-admin/edit.php3.58 ▲0.2247.65 ▼1.01
Add New Post /wp-admin/post-new.php6.07 ▲0.1892.75 ▼2.59
Media Library /wp-admin/upload.php3.39 ▲0.1639.64 ▲1.61
Settings /wp-admin/admin.php?page=magic_post_translate/inc/admin/langs.php3.3733.37
Magic Post Translate /wp-admin/admin.php?page=magic_post_translate/inc/admin/main.php3.3737.63

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 27 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
magic_post_translate_plugin_main_settings
magic_post_translate_plugin_langs_settings
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Magic Post Translate
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲10414.41 ▲0.362.31 ▼0.0542.81 ▲1.08
Dashboard /wp-admin2,222 ▲375.83 ▼0.03130.58 ▲12.5541.10 ▼0.00
Posts /wp-admin/edit.php2,179 ▲1082.17 ▲0.1937.00 ▼6.2729.63 ▼10.20
Add New Post /wp-admin/post-new.php6,245 ▲4,72625.98 ▲2.98938.90 ▲277.5369.83 ▲8.10
Media Library /wp-admin/upload.php1,410 ▲224.20 ▼0.18103.70 ▼29.3044.89 ▼3.93
Settings /wp-admin/admin.php?page=magic_post_translate/inc/admin/langs.php9652.1525.3430.95
Magic Post Translate /wp-admin/admin.php?page=magic_post_translate/inc/admin/main.php8392.0629.3930.46

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • theysaidso_admin_options
    • magic_post_translate_plugin_main_settings
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • magic_post_translate_plugin_langs_settings

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=magic_post_translate/inc/admin/main.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=magic_post_translate/inc/admin/main.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=magic_post_translate/inc/admin/main.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=magic_post_translate/inc/admin/main.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

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:
  • Screenshots: Add images for these screenshots: #1 (Automatic Generation), #2 (Settings), #3 (Set generation for chosen posts), #4 (Change "translated" field if you want to translate it again), #5 ("Generate translation" into categories)
Please take inspiration from this readme.txt

magic-post-translate/magic-post-translate.php 92% from 13 tests

The main file in "Magic Post Translate" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin1,245 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP416756659
CSS24444413
PO File14447100
JavaScript210573

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity80.00
▷ Minimum class complexity80.00
▷ Maximum class complexity80.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2496.00%
▷ Protected methods00.00%
▷ Private methods14.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
14 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/js/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
screenshot-2.png26.01KB11.86KB▼ 54.41%
assets/js/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
assets/js/jquery-ui/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
assets/js/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%