Changeset 3461085
- Timestamp:
- 02/13/2026 10:06:17 PM (6 weeks ago)
- Location:
- woo-iran-shetab-card-field
- Files:
-
- 12 added
- 6 edited
-
tags/2.1.4 (added)
-
tags/2.1.4/includes (added)
-
tags/2.1.4/includes/DediData (added)
-
tags/2.1.4/includes/DediData/class-plugin-autoloader.php (added)
-
tags/2.1.4/includes/DediData/class-singleton.php (added)
-
tags/2.1.4/includes/ShetabCardField (added)
-
tags/2.1.4/includes/ShetabCardField/class-shetab-card-field.php (added)
-
tags/2.1.4/languages (added)
-
tags/2.1.4/languages/readme.txt (added)
-
tags/2.1.4/license.txt (added)
-
tags/2.1.4/readme.txt (added)
-
tags/2.1.4/shetab-card-field.php (added)
-
trunk/includes/DediData/class-plugin-autoloader.php (modified) (5 diffs)
-
trunk/includes/DediData/class-singleton.php (modified) (7 diffs)
-
trunk/includes/ShetabCardField/class-shetab-card-field.php (modified) (8 diffs)
-
trunk/license.txt (modified) (1 diff)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/shetab-card-field.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-iran-shetab-card-field/trunk/includes/DediData/class-plugin-autoloader.php
r3033775 r3461085 5 5 * @package DediData 6 6 */ 7 8 declare(strict_types=1);9 7 10 8 namespace DediData; … … 20 18 /** 21 19 * Name Spaces 22 * 20 * 23 21 * @var array<string> $name_spaces 24 22 */ … … 34 32 /** 35 33 * Constructor 36 * 34 * 37 35 * @param array<string> $name_spaces Name Spaces. 38 36 * @return void … … 40 38 public function __construct( array $name_spaces ) { 41 39 $this->name_spaces = $name_spaces; 42 // phpcs:ignore SlevomatCodingStandard.ControlStructures.NewWithoutParentheses.UselessParentheses43 $trace = ( new Exception() )->getTrace();40 $exception_ins = new Exception(); 41 $trace = $exception_ins->getTrace(); 44 42 if ( ! isset( $trace[0]['file'] ) ) { 45 43 new WP_Error( 'Invalid Trace for Autoload' ); 46 44 } 47 $this->plugin_file = $trace[0]['file'];45 $this->plugin_file = isset( $trace[0] ) && isset( $trace[0]['file'] ) ? $trace[0]['file'] : ''; 48 46 spl_autoload_register( array( $this, 'autoloader' ) ); 49 47 } … … 52 50 * The autoloader function checks if a class is part of a specific plugin and includes the 53 51 * corresponding class file if it exists. 54 * 52 * 55 53 * @param string $class_name The class parameter is the name of the class that needs to be auto loaded. 56 * @return void 54 * @return void Return 57 55 */ 58 public function autoloader( string $class_name ) {56 public function autoloader( string $class_name ): void { 59 57 $parts = explode( '\\', $class_name ); 60 58 // Get class name from full class name -
woo-iran-shetab-card-field/trunk/includes/DediData/class-singleton.php
r3039005 r3461085 2 2 /** 3 3 * Singleton Class 4 * 4 * 5 5 * @package DediData 6 6 */ 7 8 declare(strict_types=1);9 7 10 8 namespace DediData; 11 9 12 10 use WP_Error; 13 11 14 12 /** 15 13 * Class Singleton … … 21 19 * returned by the `getInstance()` method. It ensures that only one instance of the class is created 22 20 * and that it can be accessed globally. 23 * 24 * @var objectinstance21 * 22 * @var array<object> instance 25 23 */ 26 24 private static $instances = array(); 27 25 28 26 /** 29 27 * The private constructor prevents direct instantiation of the class. 30 * 28 * 31 29 * @param mixed $param Optional parameter. 32 * @SuppressWarnings(PHPMD.UnusedFormalParameter)33 30 */ 34 private function __construct( $param ) { // phpcs:ignore SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter31 private function __construct( $param ) { 35 32 // still empty 36 33 } … … 38 35 /** 39 36 * The function retrieves a property value from an object if it exists, otherwise it returns an error. 40 * 37 * 41 38 * @param string $property_name The parameter "property_name" is a string that represents the name of the 42 39 * property you want to retrieve from the current object. … … 44 41 * exist, a WP_Error object is returned with the message "Property '' does not exist." 45 42 */ 46 public function get( string $property_name ) {43 final public function get( string $property_name ) { 47 44 $class_name = static::class; 48 45 if ( property_exists( $class_name, $property_name ) ) { … … 56 53 * The function sets the value of a property in a PHP class if the property exists, otherwise it 57 54 * returns an error. 58 * 55 * 59 56 * @param string $property_name The name of the property you want to set the value for. 60 57 * @param mixed $value The value that you want to set for the property. 61 * @return void 58 * @return void Return 62 59 */ 63 public function set( string $property_name, $value ){60 final public function set( string $property_name, $value ): void { 64 61 $class_name = static::class; 65 62 if ( ! property_exists( $class_name, $property_name ) ) { … … 72 69 /** 73 70 * The getInstance function returns an instance of the class if it doesn't already exist. 74 * 71 * 75 72 * @param mixed $param Optional Parameter. 76 73 * @return object The instance of the class. 77 74 */ 78 public static function get_instance( $param = null ) {75 final public static function get_instance( $param = null ) { 79 76 $class_name = static::class; 80 77 if ( ! isset( self::$instances[ $class_name ] ) ) { … … 86 83 /** 87 84 * The function uses a shared instance of a class and calls a method on it. 88 * 89 * @return objectThe object of class85 * 86 * @return mixed The object of class 90 87 */ 91 protected static function use_instance_in_function_example() {88 final protected static function use_instance_in_function_example() { 92 89 $instance = self::get_instance(); 93 90 return $instance->$instance; -
woo-iran-shetab-card-field/trunk/includes/ShetabCardField/class-shetab-card-field.php
r3044089 r3461085 6 6 */ 7 7 8 declare(strict_types=1);9 10 8 namespace ShetabCardField; 11 9 … … 16 14 */ 17 15 final class Shetab_Card_Field extends \DediData\Singleton { 18 16 19 17 /** 20 18 * Plugin URL 21 * 19 * 22 20 * @var string $plugin_url 23 21 */ 24 pr ivate$plugin_url;22 protected $plugin_url; 25 23 26 24 /** 27 25 * Plugin Folder 28 * 26 * 29 27 * @var string $plugin_folder 30 28 */ 31 pr ivate$plugin_folder;29 protected $plugin_folder; 32 30 33 31 /** 34 32 * Plugin Name 35 * 33 * 36 34 * @var string $plugin_name 37 35 */ 38 pr ivate$plugin_name;36 protected $plugin_name; 39 37 40 38 /** 41 39 * Plugin Version 42 * 40 * 43 41 * @var string $plugin_version 44 42 */ 45 pr ivate$plugin_version;46 43 protected $plugin_version; 44 47 45 /** 48 46 * Plugin Slug 49 * 47 * 50 48 * @var string $plugin_slug 51 49 */ 52 pr ivate$plugin_slug;50 protected $plugin_slug; 53 51 54 52 /** 55 53 * Plugin File 56 * 54 * 57 55 * @var string $plugin_file 58 56 */ 59 pr ivate$plugin_file;57 protected $plugin_file; 60 58 61 59 /** 62 60 * Constructor 63 * 61 * 64 62 * @param mixed $plugin_file Plugin File Name. 65 63 * @see https://developer.wordpress.org/reference/functions/register_activation_hook … … 97 95 * The function is used to load frontend scripts and styles in a WordPress plugin, with support for 98 96 * RTL (right-to-left) languages. 99 * 97 * 100 98 * @return void 101 99 */ … … 112 110 wp_register_script( $this->plugin_slug, $this->plugin_url . '/assets/public/js/script.js', array(), $this->plugin_version, true ); 113 111 wp_enqueue_script( $this->plugin_slug ); 114 */ 112 */ 115 113 } 116 114 117 115 /** 118 116 * Styles for Admin 119 * 117 * 120 118 * @return void 121 119 */ … … 137 135 /** 138 136 * Activate the plugin 139 * 137 * 140 138 * @return void 141 139 * @see https://developer.wordpress.org/reference/functions/add_option … … 286 284 /** 287 285 * Set Plugin Info 288 * 286 * 289 287 * @return void 290 288 */ … … 306 304 /** 307 305 * The function "run" is a placeholder function in PHP with no code inside. 308 * 306 * 309 307 * @return void 310 308 */ … … 315 313 /** 316 314 * The admin function includes the options.php file and registers the admin menu. 317 * 315 * 318 316 * @return void 319 317 */ -
woo-iran-shetab-card-field/trunk/license.txt
r3033775 r3461085 1 Copyright 202 4 DediData.com1 Copyright 2026 ParsMizban.com 2 2 3 3 This program is free software; you can redistribute it and/or modify -
woo-iran-shetab-card-field/trunk/readme.txt
r3044095 r3461085 1 1 === Shetab Card Field For WooCommerce === 2 Contributors: dedidata,parsmizban, farhad02 Contributors: parsmizban, farhad0 3 3 Tags: woocommerce, checkout, payments, order, payment gateways 4 4 Requires at least: 6.0 5 Tested up to: 6. 46 Requires PHP: 7. 07 Stable tag: 2.1. 35 Tested up to: 6.9 6 Requires PHP: 7.4 7 Stable tag: 2.1.4 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html 10 Donate link: https:// dedidata.com10 Donate link: https://parsmizban.com 11 11 12 12 Adding a field for receiving Shetab card number for WooCommerce … … 16 16 17 17 Validated by: 18 https://wpreadme.com /18 https://wpreadme.com 19 19 https://wordpress.org/plugins/developers/readme-validator 20 20 … … 24 24 25 25 * WordPress 6.0 or greater 26 * PHP 7. 0or greater is required (PHP 8.0 or greater is recommended)26 * PHP 7.4 or greater is required (PHP 8.0 or greater is recommended) 27 27 * MySQL 5.6 or greater, OR MariaDB version 10.1 or greater, is required. 28 28 * WooCommerce … … 38 38 3. click “Add New.” 39 39 4. In the search field type the name of this plugin and then click “Search Plugins.” 40 5. Once you’ve found us, you can view details about it such as the point release, rating, and description.40 5. Once you’ve found us, you can view details about it such as the point release, rating, and description. 41 41 6. Most importantly of course, you can install it by! Click “Install Now,” and WordPress will take it from there. 42 42 7. Activate the plugin from your Plugins page … … 66 66 = 2.1.1 = 67 67 Some Bugs Fixed 68 68 69 = 2.1.0 = 69 70 Whole code rewritten and compatible with new WP version and PHP 71 70 72 = 1.0.0 = 71 * First Version73 * First Release -
woo-iran-shetab-card-field/trunk/shetab-card-field.php
r3044089 r3461085 3 3 * Plugin Name: Shetab Card Field For WooCommerce 4 4 * Description: This plugin adds a field for receiving Shetab card number in orders form in WooCommerce. 5 * Plugin URI: https:// dedidata.com6 * Author: DediData7 * Author URI: https:// dedidata.com8 * Version: 2.1. 35 * Plugin URI: https://parsmizban.com 6 * Author: ParsMizban 7 * Author URI: https://parsmizban.com 8 * Version: 2.1.4 9 9 * Requires at least: 6.0 10 * Tested up to: 6. 411 * Requires PHP: 7. 010 * Tested up to: 6.9 11 * Requires PHP: 7.4 12 12 * License: GPL v3 13 13 * License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 16 16 * @package Shetab_Card_Field 17 17 */ 18 19 declare(strict_types=1);20 18 21 19 if ( ! defined( 'ABSPATH' ) ) { … … 31 29 * 32 30 * @return object an instance of the \ShetabCardField\SHETAB_CARD class. 33 * @SuppressWarnings(PHPMD.StaticAccess)34 31 */ 35 function SHETAB_CARD_FIELD() { // phpcs:ignore Squiz.Functions.GlobalFunction.Found, WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid32 function SHETAB_CARD_FIELD() { 36 33 return \ShetabCardField\Shetab_Card_Field::get_instance( __FILE__ ); 37 34 }
Note: See TracChangeset
for help on using the changeset viewer.