78% wp-tesseract

Code Review | WP Tesseract

WordPress plugin WP Tesseract scored78%from 54 tests.

About plugin

  • Plugin page: wp-tesseract
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-5.5.0
  • WordPress version: 6.3.1
  • First release: Nov 29, 2019
  • Latest release: Aug 13, 2020
  • Number of updates: 8
  • Update frequency: every 32.4 days
  • Top authors: tattersoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,247 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.26ms] Passed 4 tests

A check of server-side resources used by WP Tesseract
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0741.23 ▼0.92
Dashboard /wp-admin3.37 ▲0.0750.64 ▲0.65
Posts /wp-admin/edit.php3.48 ▲0.1351.17 ▼1.63
Add New Post /wp-admin/post-new.php5.97 ▲0.0887.14 ▼15.15
Media Library /wp-admin/upload.php3.29 ▲0.0638.33 ▲1.51
Tesseract /wp-admin/options-general.php?page=wp-tesseract/admin/class-wp-tesseract-admin.php3.2634.54

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
ocr_language_string
theysaidso_admin_options
ocr_resize_percent
widget_theysaidso_widget
ocr_tesseract_path
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Tesseract
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.40 ▼0.958.77 ▲7.0236.73 ▼8.59
Dashboard /wp-admin2,206 ▲265.64 ▼0.0288.76 ▼3.9641.57 ▲1.76
Posts /wp-admin/edit.php2,108 ▲82.02 ▲0.0235.08 ▼2.3237.21 ▲2.08
Add New Post /wp-admin/post-new.php1,533 ▼423.80 ▲5.57665.96 ▲32.7254.94 ▼10.88
Media Library /wp-admin/upload.php1,405 ▲54.19 ▼0.0097.36 ▼8.5646.82 ▼1.07
Tesseract /wp-admin/options-general.php?page=wp-tesseract/admin/class-wp-tesseract-admin.php8671.9922.2143.55

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-tesseract/public/partials/wp-tesseract-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/wp-tesseract/admin/partials/wp-tesseract-admin-display.php:30

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add descriptions for screenshots #1, #2, #3 in wp-tesseract/assets to your readme.txt
The official readme.txt might help

wp-tesseract/wp-tesseract.php Passed 13 tests

Analyzing the main PHP file in "WP Tesseract" version 1.0.2
96 characters long description:
Add Tesseract's OCR (image-to-text) functionality to WordPress. Requires pre-installed software.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected364 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12137577318
Markdown122040
JavaScript24546
CSS2080

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity4.57
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin