77% tangible-loops-and-logic

Code Review | Loops & Logic

WordPress plugin Loops & Logic scored77%from 54 tests.

About plugin

  • Plugin page: tangible-loops-an...
  • Plugin version: 3.3.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: May 21, 2021
  • Latest release: Nov 9, 2023
  • Number of updates: 68
  • Update frequency: every 13.3 days
  • Top authors: tangibleinc (100%)

Code review

54 tests

User reviews

38 reviews

Install metrics

1,000+ active /22,631 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲6.67MB] [CPU: ▲39.89ms] 75% from 4 tests

Analyzing server-side resources used by Loops & Logic
Please fix the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 6.67MB on /wp-admin/edit.php?post_type=tangible_style)
PageMemory (MB)CPU Time (ms)
Home /10.11 ▲6.6585.74 ▲50.14
Dashboard /wp-admin9.99 ▲6.6593.41 ▲31.40
Posts /wp-admin/edit.php10.04 ▲6.6982.14 ▲35.79
Add New Post /wp-admin/post-new.php12.66 ▲6.77141.12 ▲51.57
Media Library /wp-admin/upload.php9.91 ▲6.6878.85 ▲42.24
Categories /wp-admin/edit-tags.php?taxonomy=tangible_template_category9.9168.96
Templates /wp-admin/edit.php?post_type=tangible_template9.9769.15
Settings /wp-admin/admin.php?page=tangible-template-system-settings9.8366.88
Loops & Logic /wp-admin/options-general.php?page=tangible-loops-and-logic-settings9.8270.41
Import & Export /wp-admin/admin.php?page=tangible_template_import_export9.8270.17
Layouts /wp-admin/edit.php?post_type=tangible_layout9.9775.02
Scripts /wp-admin/edit.php?post_type=tangible_script9.9772.08
Styles /wp-admin/edit.php?post_type=tangible_style9.9771.68

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2,426 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Loops & Logic
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲16514.27 ▼0.171.92 ▲0.3946.25 ▲8.68
Dashboard /wp-admin2,310 ▲1295.61 ▼0.1297.46 ▼3.6342.63 ▼0.66
Posts /wp-admin/edit.php2,216 ▲1162.14 ▲0.1442.08 ▲4.3834.79 ▼4.85
Add New Post /wp-admin/post-new.php1,776 ▲24027.22 ▲4.22714.96 ▲12.5435.86 ▼17.52
Media Library /wp-admin/upload.php1,512 ▲1154.19 ▼0.0999.70 ▼14.7741.43 ▼6.79
Categories /wp-admin/edit-tags.php?taxonomy=tangible_template_category1,3902.3137.5637.42
Templates /wp-admin/edit.php?post_type=tangible_template1,1992.3039.0830.36
Settings /wp-admin/admin.php?page=tangible-template-system-settings9261.7826.9826.57
Loops & Logic /wp-admin/options-general.php?page=tangible-loops-and-logic-settings9991.8226.9127.10
Import & Export /wp-admin/admin.php?page=tangible_template_import_export1,0992.7153.3326.41
Layouts /wp-admin/edit.php?post_type=tangible_layout1,2092.3339.2928.41
Scripts /wp-admin/edit.php?post_type=tangible_script1,2092.3037.6626.53
Styles /wp-admin/edit.php?post_type=tangible_style1,2062.3242.6628.71

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/tangible-loops-and-logic/vendor/tangible/template-system/template/modules/sass/try.php
    • > /wp-content/plugins/tangible-loops-and-logic/vendor/tangible/plugin-framework/modules/date/Carbon/vendor/symfony/translation/Resources/bin/translation-status.php
    • > /wp-content/plugins/tangible-loops-and-logic/vendor/tangible/template-system/system/integrations/beaver/field-types/tangible-template-editor.php
  • 1174× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/plugin-framework/utils/admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/template-system/system/post-types/index.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Tangible\\HTML\\Parser\\EventHandler' not found in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/template-system/html/parser/DOMTreeBuilder.php:26
    • > PHP Notice
      Undefined variable: framework in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/plugin-framework/license/deactivate.php on line 3
    • > PHP Notice
      Undefined variable: framework in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/plugin-framework/settings/fields/render.php on line 3
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/template-system/template/tags/content/field-group/flexible-content.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function register_variable_type() on null in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/template-system/template/tags/url.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Tangible\\Loop\\ListLoop' not found in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/template-system/loop/types/map/index.php:11
    • > PHP Notice
      Undefined variable: framework in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/plugin-framework/modules/analytics/cron.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function register_variable_type() on null in wp-content/plugins/tangible-loops-and-logic/vendor/tangible/template-system/template/tags/loop/query-variable.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

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
These attributes need your attention:
  • Contributors: The plugin contributors field is missing
You can take inspiration from this readme.txt

tangible-loops-and-logic/tangible-loops-and-logic.php Passed 13 tests

The entry point to "Loops & Logic" version 3.3.1 is a PHP file that has certain tags in its header comment area
57 characters long description:
A template system with content type loops and conditions.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin171,769 lines of code in 2,147 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,57725,89752,17197,462
JavaScript2649,2367,94647,351
TypeScript1231,7901,24711,046
Sass741,2822057,786
XSD392482,803
JSX193762741,959
JSON261101,802
Markdown192560653
CSS3410435610
HTML2250128
Bourne Again Shell121867
XML32038
SVG10034
Bourne Shell115930

PHP code 0% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,461)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 194)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity21.35
▷ Minimum class complexity1.00
▷ Maximum class complexity1,461.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity194.00
Code structure
Namespaces73
Interfaces59
Traits28
Classes444
▷ Abstract classes276.08%
▷ Concrete classes41793.92%
▷ Final classes18845.08%
Methods4,658
▷ Static methods64713.89%
▷ Public methods3,46374.35%
▷ Protected methods51110.97%
▷ Private methods68414.68%
Functions1,445
▷ Named functions27919.31%
▷ Anonymous functions1,16680.69%
Constants350
▷ Global constants102.86%
▷ Class constants34097.14%
▷ Public constants32896.47%

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
6 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/loops-and-logic-logo.png8.89KB3.57KB▼ 59.86%
vendor/tangible/template-system/interface/assets/vendor/glider/img/youtube-play.png5.06KB2.37KB▼ 53.04%
vendor/tangible/template-system/interface/assets/src/slider/img/controls.png2.19KB0.95KB▼ 56.49%
assets/images/loops-and-logic-logo-transparent.png6.90KB3.63KB▼ 47.35%
vendor/tangible/template-system/interface/assets/vendor/glider/img/video-play.png4.42KB1.05KB▼ 76.27%