78% sv-posts

Code Review | SV Posts

WordPress plugin SV Posts scored78%from 54 tests.

About plugin

  • Plugin page: sv-posts
  • Plugin version: 2.0.00
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Nov 18, 2019
  • Latest release: May 24, 2023
  • Number of updates: 18
  • Update frequency: every 71.4 days
  • Top authors: Matthias Reuter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,854 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.86MB] [CPU: ▲0.73ms] Passed 4 tests

This is a short check of server-side resources used by SV Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.26 ▲0.8046.85 ▲3.89
Dashboard /wp-admin4.21 ▲0.9153.94 ▲0.88
Posts /wp-admin/edit.php4.26 ▲0.9150.89 ▼4.35
Add New Post /wp-admin/post-new.php6.79 ▲0.9199.13 ▲4.74
Media Library /wp-admin/upload.php4.07 ▲0.8442.95 ▲2.48
Info /wp-admin/admin.php?page=straightvisions4.1543.96
SV Posts /wp-admin/admin.php?page=sv_posts4.1043.15

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 219 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
sv_posts_scripts_settings_sv_core_color_picker_attached
theysaidso_admin_options
sv_posts_scripts_settings_flush_css_cache
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for SV Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16214.25 ▼0.111.85 ▲0.1340.93 ▼0.97
Dashboard /wp-admin2,315 ▲1355.50 ▼0.0386.80 ▼3.9773.90 ▲30.32
Posts /wp-admin/edit.php2,229 ▲1231.97 ▲0.0034.50 ▼4.9433.02 ▼2.11
Add New Post /wp-admin/post-new.php6,329 ▲4,80319.39 ▼3.671,052.14 ▲419.7240.70 ▼10.81
Media Library /wp-admin/upload.php1,532 ▲1294.18 ▼0.0594.99 ▼3.1781.13 ▲34.52
Info /wp-admin/admin.php?page=straightvisions1,58010.64196.07136.99
SV Posts /wp-admin/admin.php?page=sv_posts1,46610.5083.20140.96

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • sv_posts_scripts_settings_flush_css_cache
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • sv_posts_scripts_settings_sv_core_color_picker_attached
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sv-posts/src/core_plugin/core/settings/tpl/setting_checkbox_field.php
  • 244× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'sv_core\\sv_abstract' not found in wp-content/plugins/sv-posts/src/core_plugin/core/info/info.php:5
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-posts/src/core_plugin/core/settings/tpl/setting_email.php on line 5
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-posts/src/core_plugin/core/settings/tpl/setting_textarea.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sv-posts/src/core_plugin/core/settings/tpl/setting_select_page.php:9
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-posts/src/core_plugin/core/settings/tpl/setting_checkbox_field.php on line 15
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-posts/src/core_plugin/core/settings/tpl/setting_password.php on line 8
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-posts/src/core_plugin/core/settings/tpl/setting_font_tpl/text_transform.php on line 1
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-posts/src/core_plugin/core/settings/tpl/setting_email.php on line 1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sv-posts/src/core_plugin/core/settings/tpl/setting_margin.php:22
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sv-posts/src/lib/modules/sv_posts/lib/frontend/tpl/style_list.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: masonry, grid, list, latest posts, post gallery

sv-posts/sv_posts.php 85% from 13 tests

Analyzing the main PHP file in "SV Posts" version 2.0.00
You should first fix the following items:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sv-posts.php" instead of "sv_posts.php")

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
Good job! No executable or dangerous file extensions detected24,350 lines of code in 191 files:
LanguageFilesBlank linesComment linesLines of code
JSON3007,267
PHP1001,2441,4426,143
JavaScript441,3182515,357
CSS344171253,590
PO File2423613818
SVG400587
Sass29940586
Markdown2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity21.74
▷ Minimum class complexity1.00
▷ Maximum class complexity146.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes39
▷ Abstract classes12.56%
▷ Concrete classes3897.44%
▷ Final classes00.00%
Methods474
▷ Static methods81.69%
▷ Public methods41988.40%
▷ Protected methods306.33%
▷ Private methods255.27%
Functions20
▷ Named functions00.00%
▷ Anonymous functions20100.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin