62% pythia-for-woocommerce

Code Review | Pythia for Woocommerce

WordPress plugin Pythia for Woocommerce scored62%from 54 tests.

About plugin

  • Plugin page: pythia-for-woocom...
  • Plugin version: 1.1.6
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-5.6
  • WordPress version: 6.3.1
  • First release: Oct 6, 2020
  • Latest release: Jan 18, 2021
  • Number of updates: 10
  • Update frequency: every 13.7 days
  • Top authors: pythiabot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /375 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.33MB] [CPU: ▼5.60ms] Passed 4 tests

A check of server-side resources used by Pythia for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1538.12 ▼2.72
Dashboard /wp-admin3.71 ▲0.3747.06 ▼15.02
Posts /wp-admin/edit.php3.76 ▲0.4151.54 ▲7.73
Add New Post /wp-admin/post-new.php6.31 ▲0.4386.84 ▼9.95
Media Library /wp-admin/upload.php3.63 ▲0.4138.97 ▲5.30
Setup /wp-admin/admin.php?page=wc_pythia_setup3.5534.45
Login /wp-admin/admin.php?page=wc_pythia_login3.5436.07
Pythia /wp-admin/admin.php?page=wc_pythia3.5832.25

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 114 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
wp_pythia_admin_notice_wc_pythia_setup
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Pythia for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8713.27 ▼1.091.71 ▼0.1541.49 ▲2.89
Dashboard /wp-admin2,239 ▲485.86 ▲0.96100.06 ▼4.8637.79 ▼5.12
Posts /wp-admin/edit.php2,122 ▲332.14 ▲0.1440.33 ▲6.4934.61 ▼2.06
Add New Post /wp-admin/post-new.php1,564 ▲3118.42 ▼4.70594.57 ▼18.1457.45 ▼12.79
Media Library /wp-admin/upload.php1,424 ▲364.26 ▲0.0796.08 ▲1.3842.86 ▼0.19
Setup /wp-admin/admin.php?page=wc_pythia_setup1,0338.9396.2596.99
Login /wp-admin/admin.php?page=wc_pythia_login9691.8326.7237.83
Pythia /wp-admin/admin.php?page=wc_pythia1,0798.5483.8042.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Error in wp-content/plugins/pythia-for-woocommerce/inc/class-wc-pythia-sync-scheduler.php+59
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/pythia-for-woocommerce/inc/class-wc-pythia-sync-scheduler.php:59
    Stack trace:
    #0 wp-content/plugins/pythia-for-woocommerce/inc/class-wc-pythia.php(154): WC_Pythia_Sync_Scheduler::cancel_schedule()
    #1 wp-includes/class-wp-hook.php(310): WC_Pythia::on_deactivate()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(816): do_action()
  • The plugin did not uninstall correctly, leaving 114 files (5.64MB) in the plugin directory
    • (new file) admin/assets/css/fontawesome.css.map
    • (new file) admin/assets/css/bootstrap-grid.min.css
    • (new file) admin/assets/css/fontawesome.css
    • (new file) admin/assets/css/bootstrap-reboot.min.css
    • (new file) .svnignore
    • (new file) admin/assets/css/font-awesome.css
    • (new file) admin/assets/css/font-awesome.css.map
    • (new file) admin/assets/css/main.css
    • (new file) admin/assets/css/bootstrap.min.css
    • (new file) README.md
    • ...
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • wp_pythia_admin_notice_wc_pythia_setup
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Pythia_Admin' not found in wp-content/plugins/pythia-for-woocommerce/admin/class-wc-pythia-admin-google-auth.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pythia-for-woocommerce/admin/class-wc-pythia-admin-notices.php:281
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Pythia_Admin' not found in wp-content/plugins/pythia-for-woocommerce/admin/class-wc-pythia-admin-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Pythia_Admin' not found in wp-content/plugins/pythia-for-woocommerce/admin/class-wc-pythia-admin-setup.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Pythia_Admin' not found in wp-content/plugins/pythia-for-woocommerce/admin/class-wc-pythia-admin-sync.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% 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: Please take inspiration from this readme.txt

pythia-for-woocommerce/pythia-for-woocommerce.php 69% from 13 tests

The entry point to "Pythia for Woocommerce" version 1.1.6 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 170 characters long)
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Requires at least: The required version number must match the one declared in readme.txt ("4.9" instead of "5.4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected30,785 lines of code in 81 files:
LanguageFilesBlank linesComment linesLines of code
SVG701211,590
Sass152,7464510,696
CSS82,186525,378
PHP385421,3972,530
JavaScript125855525
Markdown122066

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.41
Average class complexity19.65
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes15.88%
Methods194
▷ Static methods4422.68%
▷ Public methods18997.42%
▷ Protected methods42.06%
▷ Private methods10.52%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants736.84%
▷ Class constants1263.16%
▷ Public constants12100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.95MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/full-logo-color.png4.12KB2.87KB▼ 30.51%
admin/assets/img/google.png31.93KB6.37KB▼ 80.04%
admin/assets/img/androide2.png577.59KB590.58KB0.00%
admin/assets/img/androide.png323.38KB329.87KB0.00%
admin/assets/img/arrow-right.png0.19KB0.20KB0.00%