68% tpg-get-posts

Code Review | TPG Get Posts

WordPress plugin TPG Get Posts scored68%from 54 tests.

About plugin

  • Plugin page: tpg-get-posts
  • Plugin version: 3.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 21, 2010
  • Latest release: Aug 19, 2023
  • Number of updates: 193
  • Update frequency: every 24.9 days
  • Top authors: cswaim (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /54,773 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

This is a short check of server-side resources used by TPG Get Posts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2443.70 ▲3.49
Dashboard /wp-admin3.39 ▲0.0849.71 ▼5.97
Posts /wp-admin/edit.php3.50 ▲0.1452.34 ▲1.18
Add New Post /wp-admin/post-new.php5.97 ▲0.0893.11 ▼1.61
Media Library /wp-admin/upload.php3.31 ▲0.0841.62 ▲5.50
TPG Get Posts /wp-admin/options-general.php?page=tpg-get-posts-settings3.3734.18

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

TPG Get Posts: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.34 ▼0.151.67 ▼0.4938.29 ▼3.51
Dashboard /wp-admin2,202 ▲285.61 ▲0.0290.85 ▼14.1344.02 ▼0.24
Posts /wp-admin/edit.php2,101 ▲12.03 ▲0.0738.88 ▲0.4537.02 ▼1.87
Add New Post /wp-admin/post-new.php1,540 ▲1422.81 ▼0.17677.61 ▲66.3355.78 ▼1.11
Media Library /wp-admin/upload.php1,404 ▲44.21 ▲0.03100.98 ▼8.7544.64 ▼0.45
TPG Get Posts /wp-admin/options-general.php?page=tpg-get-posts-settings1,9162.0139.0755.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/tpg-get-posts/uninstall.php+11
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tpg-get-posts/inc/doc-text.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tpg-get-posts/inc/doc-text.php:253
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/tpg-get-posts/inc/class-tpg-upgrader.php on line 6
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/class-wp-upgrader.php' (include_path='.:/usr/share/php') in wp-content/plugins/tpg-get-posts/inc/class-tpg-upgrader.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/tpg-get-posts/tpg-get-posts.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'tpg_gp_process' not found in wp-content/plugins/tpg-get-posts/ext/class-tpg-gp-process-ext.php:10
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/class-wp-upgrader.php): failed to open stream: No such file or directory in wp-content/plugins/tpg-get-posts/inc/class-tpg-upgrader.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: get posts, post, list, formatting, posts...

tpg-get-posts/tpg-get-posts.php Passed 13 tests

This is the main PHP file of "TPG Get Posts" version 3.6.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
53 characters long description:
Adds a shortcode tag to display posts on static page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin2,137 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP134401,3591,996
CSS22734136
JavaScript1365

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity31.11
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods95
▷ Static methods66.32%
▷ Public methods95100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/tabs.png2.79KB2.25KB▼ 19.37%