10% product-question-and-answer

Code Review | Product Question and Answer

WordPress plugin Product Question and Answer scored10%from 54 tests.

About plugin

  • Plugin page: product-question-...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.2
  • WordPress version: 6.3.1
  • First release: Mar 3, 2020
  • Latest release: Mar 3, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: acespritech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /452 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Parse error in wp-content/plugins/product-question-and-answer/q_and_a.php+420
    syntax error, unexpected '}', expecting end of file

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.84ms] Passed 4 tests

Analyzing server-side resources used by Product Question and Answer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.87 ▲2.47
Dashboard /wp-admin3.31 ▲0.0049.55 ▲0.85
Posts /wp-admin/edit.php3.36 ▲0.0047.35 ▼5.83
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.14 ▼8.27
Media Library /wp-admin/upload.php3.23 ▲0.0036.36 ▲1.88

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Product Question and Answer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.121.73 ▼0.1044.19 ▼0.67
Dashboard /wp-admin2,195 ▲155.59 ▼0.1188.83 ▲1.0441.57 ▼0.48
Posts /wp-admin/edit.php2,100 ▲32.03 ▲0.0434.88 ▼4.7836.94 ▲0.38
Add New Post /wp-admin/post-new.php1,534 ▼118.26 ▲0.07597.75 ▼61.9575.03 ▲6.72
Media Library /wp-admin/upload.php1,400 ▼04.15 ▼0.0695.42 ▼15.1642.40 ▼3.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

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 take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/product-question-and-answer/answer.php on line 88
    • > PHP Parse error
      syntax error, unexpected '}', expecting end of file in wp-content/plugins/product-question-and-answer/q_and_a.php on line 420
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/product-question-and-answer/tabs_qa.php on line 200

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed: The official readme.txt is a good inspiration

product-question-and-answer/q_and_a.php 85% from 13 tests

The main PHP script in "Product Question and Answer" version 1.1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("product-question-and-answer.php" instead of "q_and_a.php")

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
Everything looks great! No dangerous files found in this plugin17,056 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
SVG30129,026
JavaScript2409664,059
CSS21,45193,183
PHP518046788

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
image/dis-approve-icon.png17.28KB6.70KB▼ 61.23%
image/approve-icon.png9.51KB3.18KB▼ 66.61%