84% lingmo-translator

Code Review | Lingmo Translator

WordPress plugin Lingmo Translator scored 84% from 54 tests.

About plugin

  • Plugin page: lingmo-translator
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-5.3.2
  • WordPress version: 6.3.1
  • First release: May 14, 2020
  • Latest release: Jul 30, 2020
  • Number of updates: 16
  • Update frequency: every 4.9 days
  • Top authors: lingmodev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 572 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.40ms] Passed 4 tests

This is a short check of server-side resources used by Lingmo Translator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.17 ▲3.79
Dashboard /wp-admin3.40 ▲0.0945.02 ▼8.26
Posts /wp-admin/edit.php3.51 ▲0.1544.98 ▼2.28
Add New Post /wp-admin/post-new.php5.98 ▲0.0993.86 ▼0.54
Media Library /wp-admin/upload.php3.32 ▲0.0932.51 ▼2.53

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Lingmo Translator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲17113.76 ▼0.6912.38 ▲10.3041.90 ▼7.42
Dashboard /wp-admin2,231 ▲404.86 ▼0.01107.03 ▲0.9542.83 ▲2.20
Posts /wp-admin/edit.php2,111 ▲222.02 ▲0.0440.91 ▲2.7636.46 ▲5.40
Add New Post /wp-admin/post-new.php1,538 ▲1923.21 ▲0.01645.13 ▲8.3555.98 ▼12.09
Media Library /wp-admin/upload.php1,404 ▲194.21 ▲0.0596.88 ▲0.2641.44 ▼0.69

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_lingmo_widget
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/lingmo-translator/widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lingmo-translator/lingmo-translator.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
6 plugin tags: translation, lingmo, multilingual, translate, translate wordpress...

lingmo-translator/lingmo-translator.php Passed 13 tests

Analyzing the main PHP file in "Lingmo Translator" version 1.0.0
108 characters long description:
Lingmo Translator Plugin - Provides shortcode & widgets to embed Lingmo Translator in your Wordpress website

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected2,323 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS233501,167
PHP29231682
JSON120474
JavaScript1010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
143 PNG files occupy 0.23MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/english_nz.png1.54KB0.79KB▼ 48.61%
flags/greek.png1.21KB0.39KB▼ 67.50%
flags/hongkong.png1.43KB0.59KB▼ 58.41%
flags/assamese.png1.17KB0.37KB▼ 68.59%
flags/bulgarian.png0.97KB0.15KB▼ 84.77%