10% sema-api

Code Review | SEMA API

WordPress plugin SEMA API scored10%from 54 tests.

About plugin

  • Plugin page: sema-api
  • Plugin version: 4.66
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3
  • WordPress version: 6.3.1
  • First release: May 7, 2020
  • Latest release: Sep 8, 2023
  • Number of updates: 129
  • Update frequency: every 9.5 days
  • Top authors: ssema (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /5,823 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/sema-api/sema-api.php+918
    Undefined index: sema_token

Server metrics [RAM: ▼0.63MB] [CPU: ▼9.36ms] Passed 4 tests

An overview of server-side resources used by SEMA API
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0557.40 ▲16.93
Dashboard /wp-admin3.34 ▲0.0447.83 ▲2.14
Posts /wp-admin/edit.php3.46 ▲0.1048.11 ▲1.50
Add New Post /wp-admin/post-new.php3.22 ▼2.6638.44 ▼50.46
Media Library /wp-admin/upload.php3.26 ▲0.0343.97 ▲9.40
SEMA Import /wp-admin/options-general.php?page=sema_import3.3535.75
SEMA Setting /wp-admin/options-general.php?page=sema_setting3.2134.01

Server storage [IO: ▲1.62MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 54 new files
Database: 5 new tables, 8 new options
New tables
wp_sema_fitment
wp_sema_products
wp_sema_attr_taxonomy
wp_sema_brands
wp_sema_parts
New WordPress options
widget_recent-comments
widget_recent-posts
sema_plugin_version
theysaidso_admin_options
sema_settings
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for SEMA API
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,058 ▲32314.56 ▲0.198.79 ▲6.7945.86 ▼1.50
Dashboard /wp-admin2,251 ▲635.49 ▼0.53119.27 ▲10.3644.55 ▲6.38
Posts /wp-admin/edit.php2,118 ▲292.56 ▲0.5040.00 ▼0.4930.05 ▼8.97
Add New Post /wp-admin/post-new.php1,717 ▲17523.21 ▲5.09667.69 ▲64.3037.07 ▼30.31
Media Library /wp-admin/upload.php1,447 ▲594.74 ▲0.5291.10 ▼5.8142.85 ▼2.49
SEMA Import /wp-admin/options-general.php?page=sema_import1,0612.4345.6429.83
SEMA Setting /wp-admin/options-general.php?page=sema_setting1,2062.6346.5529.59

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • sema_plugin_version
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=sema_import
    • > Notice in wp-content/plugins/sema-api/includes/views/html-sema-import-greeting.php+16
    Undefined index: siteid
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+350
    Undefined index: sema_token
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+438
    Undefined index: sema_aaia
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+269
    Undefined index: Success
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+284
    Undefined variable: membership
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+353
    Undefined index: sema_username
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+354
    Undefined index: sema_password
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+360
    Undefined index: sema_user
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+368
    Undefined variable: setting_saved
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+369
    Undefined variable: errormessage
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+439
    Undefined index: sema_membership
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+441
    Undefined index: rebuild_fitment_point
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Notice in wp-content/plugins/sema-api/options.php+443
    Undefined index: category_exist

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
The following issues need your attention
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/sema-api/includes/views/html-sema-fitment-new.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sema-api/options.php:27
    • > PHP Notice
      Undefined index: fitmentid in wp-content/plugins/sema-api/includes/views/html-sema-fitment-edit.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sema-api/options.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/sema-api/includes/views/html-sema-import-greeting.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_placeholder_img_src() in wp-content/plugins/sema-api/includes/views/html-sema-fitment-edit.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/sema-api/includes/views/html-sema-fitment.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sema_setting
    • > Network (severe)
    wp-content/plugins/woocommerce/assets/css/admin.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: auto parts search, year make model search, product import, auto parts filter, year make model filter...

sema-api/sema-api.php Passed 13 tests

The main file in "SEMA API" v. 4.66 serves as a complement to information provided in readme.txt and as the entry point to the plugin
100 characters long description:
Via SEMA API, add auto parts search to your wordpress and import products to your WooCommerce Store.

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin33,912 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,2614,85018,013
CSS102,09431310,477
PHP119821,0515,422

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 149)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity132.00
▷ Minimum class complexity4.00
▷ Maximum class complexity462.00
Average method complexity9.40
▷ Minimum method complexity1.00
▷ Maximum method complexity149.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods53
▷ Static methods35.66%
▷ Public methods5196.23%
▷ Protected methods11.89%
▷ Private methods11.89%
Functions28
▷ Named functions2692.86%
▷ Anonymous functions27.14%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
21 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/insertpages_toolbar_icon_backup.png1.29KB0.50KB▼ 61.03%
images/wf-success.png3.24KB0.59KB▼ 81.90%
images/pdf_icon.png1.27KB0.44KB▼ 65.82%
images/wf-import.png1.62KB1.39KB▼ 14.10%
images/32px.png5.53KB2.93KB▼ 47.10%