10% 2step-reviews-app

Code Review | 2 Step Reviews

WordPress plugin 2 Step Reviews scored10%from 54 tests.

About plugin

  • Plugin page: 2step-reviews-app
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: May 14, 2019
  • Latest release: Jun 5, 2019
  • Number of updates: 17
  • Update frequency: every 1.8 days
  • Top authors: ricardoalmira89 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /660 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/2step-reviews-app/two-step-reviews-app.php+94
    date_default_timezone_set(): Timezone ID '' is invalid

Server metrics [RAM: ▼1.38MB] [CPU: ▼52.41ms] Passed 4 tests

Analyzing server-side resources used by 2 Step Reviews
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.61 ▼0.858.54 ▼32.85
Dashboard /wp-admin2.63 ▼0.6811.80 ▼38.99
Posts /wp-admin/edit.php2.63 ▼0.7310.95 ▼37.57
Add New Post /wp-admin/post-new.php2.63 ▼3.2611.02 ▼100.23
Media Library /wp-admin/upload.php2.63 ▼0.6011.68 ▼23.61
2Step /wp-admin/admin.php?page=2step-reviews-app/config-page.php2.638.77
Reviews /wp-admin/admin.php?page=2step-reviews-app/show-reviews.php2.6312.41

Server storage [IO: ▲3.04MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Illegal file modification found: 1 file (0.00KB) outside of "wp-content/plugins/2step-reviews-app/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/2step-reviews-app/assets/images/logo-256\303\227256.png"
Filesystem: 887 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by 2 Step Reviews
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲8614.40 ▼0.001.79 ▼0.3244.43 ▼0.58
Dashboard /wp-admin2,232 ▲445.79 ▼0.10145.78 ▲39.8486.70 ▲46.45
Posts /wp-admin/edit.php2,118 ▲292.00 ▼0.0644.31 ▲3.0334.14 ▲2.14
Add New Post /wp-admin/post-new.php1,710 ▲19624.83 ▲7.21695.78 ▲35.9647.52 ▼22.25
Media Library /wp-admin/upload.php1,399 ▲174.16 ▼0.07105.94 ▼19.70117.97 ▲65.97
2Step /wp-admin/admin.php?page=2step-reviews-app/config-page.php1,1052.0226.6769.82
Reviews /wp-admin/admin.php?page=2step-reviews-app/show-reviews.php7882.0128.7128.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/2step-reviews-app/two-step-reviews-app.php+94
    date_default_timezone_set(): Timezone ID '' is invalid
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/show-reviews.php
    • > Notice in wp-content/plugins/2step-reviews-app/two-step-reviews-app.php+94
    date_default_timezone_set(): Timezone ID '' is invalid
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/show-reviews.php
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Two_Step_Reviews_App::add_menu_admin() should not be called statically
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/config-page.php
    • > Notice in wp-content/plugins/2step-reviews-app/config-page.php+10
    Undefined index: username
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/config-page.php
    • > Notice in wp-content/plugins/2step-reviews-app/config-page.php+32
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/config-page.php
    • > User deprecated in wp-content/plugins/2step-reviews-app/vendor/twig/twig/lib/Twig/Loader/Filesystem.php+7
    Using the "Twig_Loader_Filesystem" class is deprecated since Twig version 2.7, use "Twig\Loader\FilesystemLoader" instead.
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/config-page.php
    • > User deprecated in wp-content/plugins/2step-reviews-app/vendor/twig/twig/lib/Twig/Environment.php+7
    Using the "Twig_Environment" class is deprecated since Twig version 2.7, use "Twig\Environment" instead.
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/config-page.php
    • > User deprecated in wp-content/plugins/2step-reviews-app/vendor/twig/twig/lib/Twig/Extension/Debug.php+7
    Using the "Twig_Extension_Debug" class is deprecated since Twig version 2.7, use "Twig\Extension\DebugExtension" instead.
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/config-page.php
    • > Deprecated in wp-content/plugins/2step-reviews-app/vendor/twig/twig/src/Node/Node.php+43
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/config-page.php
    • > User deprecated in wp-content/plugins/2step-reviews-app/vendor/twig/twig/lib/Twig/SimpleFilter.php+19
    Using the "Twig_SimpleFilter" class is deprecated since Twig version 2.7, use "Twig\TwigFilter" instead.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/show-reviews.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/show-reviews.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 19 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/show-reviews.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=2step-reviews-app/show-reviews.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 326× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Timber\\User' not found in wp-content/plugins/2step-reviews-app/vendor/timber/timber/lib/Integrations/CoAuthorsPlusUser.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/2step-reviews-app/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/2step-reviews-app/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Sandbox\\SecurityError' not found in wp-content/plugins/2step-reviews-app/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/2step-reviews-app/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Psr7\\Request' not found in wp-content/plugins/2step-reviews-app/vendor/guzzlehttp/psr7/src/ServerRequest.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/2step-reviews-app/vendor/twig/twig/src/Node/TextNode.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Composer\\Plugin\\PluginInterface' not found in wp-content/plugins/2step-reviews-app/vendor/composer/installers/src/Composer/Installers/Plugin.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/2step-reviews-app/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/2step-reviews-app/vendor/twig/twig/src/TokenParser/UseTokenParser.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("none")
You can look at the official readme.txt

2step-reviews-app/two-step-reviews-app.php 85% from 13 tests

Analyzing the main PHP file in "2 Step Reviews" version 1.0.1
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 197 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("2step-reviews-app.php" instead of "two-step-reviews-app.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please fix the following items
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/2step-reviews-app/vendor/bin/var-dump-server.bat
44,814 lines of code in 857 files:
LanguageFilesBlank linesComment linesLines of code
PHP6497,34015,14632,938
Markdown552,30706,334
reStructuredText922,0941,9342,729
JSON18001,602
XML173053529
Bourne Shell55815265
Twig93016213
YAML8342189
make1409
DOS Batch1004
CSS20472

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity6.84
▷ Minimum class complexity1.00
▷ Maximum class complexity172.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces52
Interfaces34
Traits2
Classes586
▷ Abstract classes152.56%
▷ Concrete classes57197.44%
▷ Final classes6010.51%
Methods2,307
▷ Static methods36615.86%
▷ Public methods1,90882.70%
▷ Protected methods1908.24%
▷ Private methods2099.06%
Functions301
▷ Named functions16554.82%
▷ Anonymous functions13645.18%
Constants134
▷ Global constants1410.45%
▷ Class constants12089.55%
▷ Public constants120100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
assets/images/logo-256×256.png34.08KB8.68KB▼ 74.53%
media/icon.png0.79KB0.66KB▼ 16.79%