79% tma-wc-producttargeting

Code Review | TMA-WC-ProductTargeting

WordPress plugin TMA-WC-ProductTargeting scored79%from 54 tests.

About plugin

  • Plugin page: tma-wc-producttar...
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.1-4.5.1
  • WordPress version: 6.3.1
  • First release: Feb 5, 2016
  • Latest release: Apr 27, 2016
  • Number of updates: 4
  • Update frequency: every 23.0 days
  • Top authors: thmarx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /515 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.11ms] Passed 4 tests

This is a short check of server-side resources used by TMA-WC-ProductTargeting
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.07 ▼2.69
Dashboard /wp-admin3.31 ▲0.0150.59 ▲0.52
Posts /wp-admin/edit.php3.36 ▲0.0148.73 ▲2.64
Add New Post /wp-admin/post-new.php5.89 ▲0.0194.97 ▲8.11
Media Library /wp-admin/upload.php3.23 ▲0.0133.76 ▼0.93
WC ProductTargeting /wp-admin/admin.php?page=tma-producttargeting-setting3.2230.37

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by TMA-WC-ProductTargeting
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.33 ▼1.274.15 ▲2.2441.82 ▼2.29
Dashboard /wp-admin2,206 ▲185.80 ▼0.1099.23 ▼14.1838.44 ▼8.47
Posts /wp-admin/edit.php2,086 ▼32.06 ▲0.0138.88 ▲2.7635.04 ▲2.61
Add New Post /wp-admin/post-new.php1,542 ▲718.20 ▼4.86629.39 ▼25.2762.08 ▼9.84
Media Library /wp-admin/upload.php1,391 ▲34.19 ▼0.0095.23 ▲0.2142.29 ▼0.95
WC ProductTargeting /wp-admin/admin.php?page=tma-producttargeting-setting8262.0223.5927.63

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tma-wc-producttargeting/pages/documentation.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function TMA\\is_admin() in wp-content/plugins/tma-wc-producttargeting/includes/tma_product_targeting_settingspage.php:66

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
2 plugin tags: content targeting, product targeting

tma-wc-producttargeting/tma-wc-producttargeting.php Passed 13 tests

This is the main PHP file of "TMA-WC-ProductTargeting" version 0.4.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
39 characters long description:
ProductTargeting plugin for WooCommerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin3,041 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2711421,935
HTML11250567
CSS2455273
PHP766172253
SVG11013

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity4.50
▷ Minimum class complexity2.00
▷ Maximum class complexity8.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods1285.71%
▷ Protected methods00.00%
▷ Private methods214.29%
Functions3
▷ Named functions3100.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
There are no PNG files in this plugin