10% porsline

Code Review | Porsline

WordPress plugin Porsline scored10%from 54 tests.

About plugin

  • Plugin page: porsline
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0
  • WordPress version: 6.3.1
  • First release: May 24, 2022
  • Latest release: Jul 13, 2022
  • Number of updates: 21
  • Update frequency: every 2.4 days
  • Top authors: porsline (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

300+ active /3,774 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-includes/plugin.php+1001
    Undefined offset: 0

Server metrics [RAM: ▼1.90MB] [CPU: ▼49.29ms] Passed 4 tests

Analyzing server-side resources used by Porsline
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.386.69 ▼28.26
Dashboard /wp-admin2.10 ▼1.208.07 ▼42.16
Posts /wp-admin/edit.php2.10 ▼1.259.08 ▼39.85
Add New Post /wp-admin/post-new.php2.10 ▼3.788.32 ▼86.87
Media Library /wp-admin/upload.php2.10 ▼1.127.65 ▼27.28
Plugin settings /wp-admin/admin.php?page=porsline-settings2.108.01
My forms /wp-admin/admin.php?page=porsline-surveys2.109.43

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 72 new files
Database: 2 new tables, 6 new options
New tables
wp_porsline_settings
wp_porsline_survay_styles
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Porsline
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.14 ▼0.211.84 ▲0.2443.94 ▼1.10
Dashboard /wp-admin2,214 ▲435.69 ▼0.0784.31 ▼18.2077.32 ▲34.15
Posts /wp-admin/edit.php2,128 ▲281.98 ▼0.0439.42 ▲4.6033.21 ▼3.51
Add New Post /wp-admin/post-new.php1,568 ▲4218.19 ▼4.94646.72 ▼46.5663.74 ▲8.95
Media Library /wp-admin/upload.php1,422 ▲224.23 ▼0.0299.58 ▼9.8271.16 ▲23.62
Plugin settings /wp-admin/admin.php?page=porsline-settings9193.9536.0438.72
My forms /wp-admin/admin.php?page=porsline-surveys9173.9638.0750.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-includes/plugin.php+1001
    Undefined offset: 0
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_porsline_settings
    • wp_porsline_survay_styles
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=porsline-surveys
    • > Notice in wp-includes/plugin.php+1004
    Undefined offset: 0
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=porsline-surveys
    • > Notice in wp-content/plugins/porsline/panel/menu.php+32
    Undefined index: survey_list_page_title
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=porsline-surveys
    • > Notice in wp-content/plugins/porsline/panel/menu.php+46
    Undefined index: settings-page-title
    • > GET request to /wp-admin/admin.php?page=porsline-surveys
    • > Deprecated in wp-content/plugins/porsline/panel/survey-list.php+414
    array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead
    • > GET request to /wp-admin/admin.php?page=porsline-surveys
    • > Notice in wp-content/plugins/porsline/panel/survey-list.php+454
    Undefined index: porsline-add-new-survey-from-link
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=porsline-surveys
    • > Notice in wp-content/plugins/porsline/panel/survey-list.php+559
    Trying to get property 'id' of non-object
    • > GET request to /wp-admin/admin.php?page=porsline-surveys
    • > Notice in wp-content/plugins/porsline/panel/survey-list.php+514
    Trying to get property 'name' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=porsline-surveys
    • > Notice in wp-content/plugins/porsline/panel/survey-list.php+563
    Trying to get property 'surveys' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=porsline-surveys
    • > Warning in wp-content/plugins/porsline/panel/survey-list.php+563
    count(): Parameter must be an array or an object that implements Countable

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/porsline/view/shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/porsline/view/active_plugin.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/porsline/panel/menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/porsline/view/active_plugin.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/porsline/panel/welcome.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/porsline/panel/survey-list.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/porsline/view/auth-api-ajax.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/porsline/panel/settings.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=porsline-settings
    • > Network (severe)
    wp-content/plugins/porsline/panel/settings.php?ver=6.3.1 - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

porsline/porsline.php Passed 13 tests

The main PHP file in "Porsline" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
82 characters long description:
Making glorious online forms, surveys & quizzes is only a simple drag & drop away!

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
Success! There were no dangerous files found in this plugin9,375 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5597684,188
PHP142,676343,229
CSS82,341271,945
SVG20013

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
25 PNG files occupy 1.74MB with 0.90MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/welcome/steps/step-1.png10.64KB8.34KB▼ 21.55%
assets/img/icon.png1.01KB0.65KB▼ 35.71%
assets/img/welcome/forms-templates-ar.png104.08KB112.66KB0.00%
(invalid) assets/screenshots/create-form-fa.png22.13KB0.00KB▼ 100.00%
(invalid) assets/screenshots/create-form-tr.png22.41KB0.00KB▼ 100.00%