84% data-captia

Code Review | DataCaptia - Open Graph plugin for WordPress

WordPress plugin DataCaptia - Open Graph plugin for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: data-captia
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 23, 2021
  • Latest release: Aug 16, 2023
  • Number of updates: 16
  • Update frequency: every 56.8 days
  • Top authors: htplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /895 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.23MB] [CPU: ▼2.83ms] 75% from 4 tests

An overview of server-side resources used by DataCaptia - Open Graph plugin for WordPress
It is recommended to improve the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,389.69ms on /wp-admin/admin.php?page=datacaptia-recommendations)
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2544.73 ▲5.55
Dashboard /wp-admin3.54 ▲0.1955.13 ▼10.18
Posts /wp-admin/edit.php3.65 ▲0.2951.33 ▲4.76
Add New Post /wp-admin/post-new.php6.12 ▲0.2387.32 ▼8.55
Media Library /wp-admin/upload.php3.46 ▲0.2340.40 ▲2.67
DataCaptia /wp-admin/admin.php?page=data-captia-setting-page3.5044.98
Recommendations /wp-admin/admin.php?page=datacaptia-recommendations7.741,389.69

Server storage [IO: ▲0.28MB] [DB: ▲0.67MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for DataCaptia - Open Graph plugin for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6514.25 ▼0.101.88 ▲0.3544.84 ▲2.57
Dashboard /wp-admin2,205 ▲255.52 ▼0.0283.29 ▼3.8881.22 ▲40.76
Posts /wp-admin/edit.php2,127 ▲272.01 ▼0.0034.01 ▼3.6734.21 ▼0.14
Add New Post /wp-admin/post-new.php1,385 ▼14116.43 ▼7.26607.23 ▼94.2548.65 ▼20.01
Media Library /wp-admin/upload.php1,424 ▲244.23 ▲0.0095.34 ▼19.8571.50 ▲23.34
DataCaptia /wp-admin/admin.php?page=data-captia-setting-page1,3193.6550.8563.76
Recommendations /wp-admin/admin.php?page=datacaptia-recommendations2,9222.2229.1267.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/data-captia/admin/template/option-setting.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'Data_Capatia_Open_Graph' not found in wp-content/plugins/data-captia/includes/product-graph.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/data-captia/admin/template/general-setting.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'Data_Capatia_Open_Graph' not found in wp-content/plugins/data-captia/includes/post-graph.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Data_Capatia_Open_Graph' not found in wp-content/plugins/data-captia/includes/page-graph.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/data-captia/includes/data-captia.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: ogtitle, graph, social share, datacaptia, open graph

data-captia/data-captia.php Passed 13 tests

The main file in "DataCaptia - Open Graph plugin for WordPress" v. 1.0.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
55 characters long description:
Easily enable og information OpenGraph in your website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,264 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP91841221,038
JavaScript35032194
CSS24032

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.50
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods38.82%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
18 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) admin/assets/images/extensions/ht-google-place-review.png2.64KB0.00KB▼ 100.00%
admin/assets/images/extensions/whols-pro.png15.30KB7.40KB▼ 51.65%
admin/assets/images/extensions/just-tables-pro.png1.02KB1.05KB0.00%
admin/assets/images/extensions/swatchly-pro.png13.99KB5.41KB▼ 61.37%
admin/assets/images/default.png2.52KB1.29KB▼ 48.76%