├── .github └── workflows │ └── php.yml ├── .gitignore ├── .idea ├── encodings.xml ├── frontend-dashboard.iml ├── inspectionProfiles │ └── profiles_settings.xml ├── misc.xml ├── modules.xml └── workspace.xml ├── LICENSE ├── README.md ├── assets ├── admin │ ├── css │ │ ├── fed_admin_style.css │ │ └── fed_global_admin_style.css │ ├── images │ │ ├── chat.png │ │ ├── demo.png │ │ ├── index.php │ │ ├── inputs │ │ │ ├── checkbox.png │ │ │ ├── email.png │ │ │ ├── multi_line.png │ │ │ ├── number.png │ │ │ ├── password.png │ │ │ ├── radio.png │ │ │ ├── select.png │ │ │ ├── single_line.png │ │ │ └── url.png │ │ ├── mail.png │ │ ├── plugins │ │ │ ├── frontend_dashboard_captcha.jpg │ │ │ ├── frontend_dashboard_extra.jpg │ │ │ └── frontend_dashboard_pages.jpg │ │ ├── pro │ │ │ ├── buy-now-149.png │ │ │ ├── buy-now-29.png │ │ │ ├── buy-now-49.png │ │ │ └── buy-now-99.png │ │ ├── rate.png │ │ ├── template_1.png │ │ └── tickets.png │ ├── index.php │ └── js │ │ ├── fed_admin_script.js │ │ └── fed_menu_sort.js └── frontend │ ├── css │ ├── -bootstrap.css │ ├── -bootstrap.min.css.map │ ├── animate.css │ ├── bootstrap.css │ ├── common-style.css │ ├── datatables.css │ ├── flatpickr.css │ ├── fontawesome-shims.css │ ├── fontawesome.css │ ├── select2.css │ └── sweetalert2.css │ ├── fonts │ ├── OpenSans-Regular.ttf │ ├── Roboto-Regular.ttf │ ├── fa-brands-400.eot │ ├── fa-brands-400.svg │ ├── fa-brands-400.ttf │ ├── fa-brands-400.woff │ ├── fa-brands-400.woff2 │ ├── fa-regular-400.eot │ ├── fa-regular-400.svg │ ├── fa-regular-400.ttf │ ├── fa-regular-400.woff │ ├── fa-regular-400.woff2 │ ├── fa-solid-900.eot │ ├── fa-solid-900.svg │ ├── fa-solid-900.ttf │ ├── fa-solid-900.woff │ └── fa-solid-900.woff2 │ ├── images │ ├── d.png │ └── datatables │ │ ├── sort_asc.png │ │ ├── sort_asc_disabled.png │ │ ├── sort_both.png │ │ ├── sort_desc.png │ │ └── sort_desc_disabled.png │ └── js │ ├── -bootstrap.js │ ├── bootstrap.js │ ├── datatables.js │ ├── fed_common.js │ ├── fed_script.js │ ├── flatpickr.js │ ├── fontawesome-shims.js │ ├── fontawesome.js │ ├── jscolor.js │ ├── new_sweetalert2.js │ ├── select2.js │ ├── sweetalert.js │ └── sweetalert2.js ├── composer.json ├── fed-autoload.php ├── frontend-dashboard.php ├── includes ├── admin │ ├── controllers │ │ ├── class-fed-taxonomy.php │ │ └── class-fed-terms.php │ ├── fields │ │ ├── fed-form-checkbox.php │ │ ├── fed-form-email.php │ │ ├── fed-form-hidden.php │ │ ├── fed-form-multiline.php │ │ ├── fed-form-number.php │ │ ├── fed-form-password.php │ │ ├── fed-form-radio.php │ │ ├── fed-form-select.php │ │ ├── fed-form-singleline.php │ │ ├── fed-form-url.php │ │ └── index.php │ ├── function-admin.php │ ├── hooks │ │ ├── class-fed-action-hooks.php │ │ └── index.php │ ├── index.php │ ├── install │ │ ├── class-fed-install-addons.php │ │ ├── index.php │ │ ├── initial-setup.php │ │ ├── install.php │ │ └── update.php │ ├── layout │ │ ├── add-edit-profile.php │ │ ├── class-fed-admin-user-profile.php │ │ ├── custom_layout │ │ │ ├── fed-custom-css.php │ │ │ ├── helper.php │ │ │ └── index.php │ │ ├── error.php │ │ ├── index.php │ │ ├── input_fields │ │ │ ├── checkbox.php │ │ │ ├── common.php │ │ │ ├── email.php │ │ │ ├── index.php │ │ │ ├── number.php │ │ │ ├── password.php │ │ │ ├── radio.php │ │ │ ├── select.php │ │ │ ├── text.php │ │ │ ├── textarea.php │ │ │ └── url.php │ │ ├── metabox │ │ │ ├── index.php │ │ │ └── post-meta-box.php │ │ └── settings_tab │ │ │ ├── email │ │ │ ├── class-fed-email.php │ │ │ └── index.php │ │ │ ├── general │ │ │ ├── class-fed-admin-general.php │ │ │ └── index.php │ │ │ ├── index.php │ │ │ ├── login │ │ │ ├── frontend-login-menu.php │ │ │ ├── index.php │ │ │ ├── login-tab.php │ │ │ ├── register-tab.php │ │ │ ├── restrict-username.php │ │ │ ├── restrict-wp-tab.php │ │ │ └── settings.php │ │ │ ├── post │ │ │ ├── dashboard.php │ │ │ ├── index.php │ │ │ ├── menu.php │ │ │ ├── permissions.php │ │ │ ├── post-tab.php │ │ │ └── settings.php │ │ │ ├── user │ │ │ ├── index.php │ │ │ ├── role.php │ │ │ ├── user-tab.php │ │ │ └── user-upload.php │ │ │ └── user_profile │ │ │ ├── index.php │ │ │ ├── settings.php │ │ │ └── user-profile-tab.php │ ├── menu │ │ ├── class-fed-admin-menu.php │ │ ├── index.php │ │ └── items │ │ │ ├── add-profile-post-fields.php │ │ │ ├── addons.php │ │ │ ├── dashboard-menu.php │ │ │ ├── help.php │ │ │ ├── index.php │ │ │ ├── post-fields.php │ │ │ ├── status.php │ │ │ └── user-profile.php │ ├── model │ │ ├── common.php │ │ ├── index.php │ │ ├── menu.php │ │ └── user-profile.php │ ├── payment │ │ ├── class-fed-invoice-template.php │ │ ├── class-fed-invoice.php │ │ ├── class-fed-payment-menu.php │ │ ├── class-fed-payment-widgets.php │ │ ├── class-fed-payment.php │ │ ├── class-fed-transaction.php │ │ ├── index.php │ │ └── payment.php │ ├── pro │ │ ├── index.php │ │ └── plugins │ │ │ ├── class-fed-mp-pro.php │ │ │ ├── class-fed-pp-pro.php │ │ │ ├── class-fed-sc-pro.php │ │ │ └── index.php │ ├── request │ │ ├── admin.php │ │ ├── function.php │ │ ├── index.php │ │ ├── menu.php │ │ ├── orders.php │ │ ├── status.php │ │ ├── tabs │ │ │ ├── index.php │ │ │ ├── login.php │ │ │ ├── post-options.php │ │ │ ├── user-profile-layout.php │ │ │ └── user.php │ │ └── user-profile.php │ ├── validation │ │ ├── class-fed-validate.php │ │ ├── class-fed-validation.php │ │ └── index.php │ └── widgets │ │ ├── class-fed-user-count-widget.php │ │ └── index.php ├── api │ ├── index.php │ └── routes.php ├── common │ ├── function-common.php │ ├── index.php │ └── script.php ├── config │ ├── config.php │ └── index.php ├── frontend │ ├── controller │ │ ├── index.php │ │ ├── logout.php │ │ ├── menu.php │ │ ├── payment.php │ │ ├── posts.php │ │ └── profile.php │ ├── function-frontend.php │ ├── index.php │ └── request │ │ ├── index.php │ │ ├── login │ │ ├── forgot.php │ │ ├── index.php │ │ ├── login.php │ │ ├── register.php │ │ ├── reset.php │ │ └── validation.php │ │ ├── user_profile │ │ ├── index.php │ │ └── user-profile.php │ │ └── validation │ │ ├── index.php │ │ └── validation.php ├── log │ ├── class-fed-log.php │ ├── dashboard.log │ └── index.php ├── shortcodes │ ├── dashboard │ │ ├── dashboard-shortcode.php │ │ └── index.php │ ├── index.php │ ├── login │ │ ├── forgot-password-only-shortcode.php │ │ ├── index.php │ │ ├── login-data.php │ │ ├── login-only-shortcode.php │ │ ├── login-shortcode.php │ │ └── register-only-shortcode.php │ ├── payments │ │ ├── index.php │ │ └── transactions.php │ ├── user-role.php │ └── widget │ │ ├── index.php │ │ ├── posts.php │ │ └── taxonomy.php └── widgets │ └── class-fed-post-widget.php ├── index.php ├── languages ├── frontend-dashboard-ar.po ├── frontend-dashboard-es_ES.mo ├── frontend-dashboard-es_ES.po ├── frontend-dashboard-fr_FR.mo ├── frontend-dashboard-fr_FR.po ├── frontend-dashboard-he_IL.mo ├── frontend-dashboard-he_IL.po ├── frontend-dashboard-hr.mo ├── frontend-dashboard-hr.po ├── frontend-dashboard-pt-br.mo ├── frontend-dashboard-pt-br.po ├── frontend-dashboard.pot └── frontend_dashboard-ar.mo ├── readme.txt ├── route ├── class-fed-request.php ├── class-fed-routes.php └── index.php ├── templates ├── author.php ├── dashboard.php ├── index.php ├── login │ ├── forgot-password-only.php │ ├── index.php │ ├── login-only.php │ ├── register-only.php │ ├── registered-user.php │ └── unregistered-user.php ├── payments │ ├── index.php │ └── transactions.php └── user_role.php └── vendor └── template-loaders ├── index.php ├── loader ├── class-fed-template-loader.php └── index.php └── page-template ├── class-fed-page-template.php ├── index.php └── layouts ├── fed-dashboard.php ├── fed-login.php ├── fed_invoice.php └── index.php /.github/workflows/php.yml: -------------------------------------------------------------------------------- 1 | name: WordPress VIP Go Standards 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | 13 | - name: Setup PHP 14 | uses: shivammathur/setup-php@v2 15 | with: 16 | php-version: '7.3' 17 | extensions: mbstring 18 | ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1 19 | coverage: pcov 20 | tools: php-cs-fixer, phpunit 21 | 22 | - name: Validate composer.json and composer.lock 23 | run: composer validate 24 | 25 | - name: Install dependencies 26 | run: composer install --prefer-dist --no-progress --no-suggest 27 | 28 | - name: Run phpcs 29 | run: ./vendor/bin/phpcs --extensions=php --standard=WordPress-VIP-Go,WordPress-Docs ./ --ignore=.idea/*,vendor/* 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .zip 2 | .md -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/frontend-dashboard.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | $USER_HOME$/.subversion 24 | 25 | 26 | 27 | 1502066535803 28 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /assets/admin/images/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mavinothkumar/frontend-dashboard/1f0cb2e4a3c4ae21896ee9c7ebc93632845b8fe8/assets/admin/images/chat.png -------------------------------------------------------------------------------- /assets/admin/images/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mavinothkumar/frontend-dashboard/1f0cb2e4a3c4ae21896ee9c7ebc93632845b8fe8/assets/admin/images/demo.png -------------------------------------------------------------------------------- /assets/admin/images/index.php: -------------------------------------------------------------------------------- 1 | =7.3" 7 | }, 8 | "require-dev": { 9 | "squizlabs/php_codesniffer": "^3.5", 10 | "wp-coding-standards/wpcs": "2.1", 11 | "fig-r/psr2r-sniffer": "^0.5.0", 12 | "phpcompatibility/phpcompatibility-wp": "^2.0.0", 13 | "automattic/vipwpcs": "^2.0", 14 | "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2", 15 | "oomphinc/composer-installers-extender": "^1.1.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /frontend-dashboard.php: -------------------------------------------------------------------------------- 1 | 'Please Select' ) + wp_list_pluck( $taxonomies, 'label', 'name' ); 36 | wp_send_json_success( array( 37 | 'message' => $taxonomies, 38 | ) ); 39 | exit(); 40 | } 41 | 42 | wp_send_json_success( array( 'message' => array() ) ); 43 | exit(); 44 | } 45 | } 46 | 47 | new FED_Taxonomy(); 48 | } -------------------------------------------------------------------------------- /includes/admin/controllers/class-fed-terms.php: -------------------------------------------------------------------------------- 1 | fed_sanitize_text_field( $post_payload['taxonomy'] ), 33 | 'hide_empty' => false, 34 | 'orderby' => 'name', 35 | 'order' => 'ASC', 36 | 'parent' => '0', 37 | ) ); 38 | 39 | wp_send_json_success( array( 40 | 'message' => array( '0' => 'Please Select' ) + wp_list_pluck( $terms, 'name', 'term_id' ), 41 | ) ); 42 | } 43 | 44 | wp_send_json_success( array( 'message' => array() ) ); 45 | } 46 | } 47 | 48 | new FED_Terms(); 49 | } -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-checkbox.php: -------------------------------------------------------------------------------- 1 | 0 ? htmlspecialchars_decode( $extended['label'] ) : null; 31 | $label_value = $is_extended ? $is_extended : $label; 32 | $checked = checked( $value, $default_value, false ); 33 | 34 | $extended = fed_get_data( 'extended', $options ); 35 | $unseralize = $extended ? maybe_unserialize( $extended ) : null; 36 | $disable_user_access = $unseralize ? fed_get_data( 'disable_user_access', $unseralize ) : null; 37 | 38 | if ( 'Disable' === $disable_user_access && ! fed_is_admin() ) { 39 | $name = ''; 40 | $readonly = 'readonly=readonly'; 41 | $disabled = 'disabled=disabled'; 42 | } 43 | 44 | return sprintf( 45 | " 46 | ", 50 | $name, 51 | $default_value, 52 | $class, 53 | $checked, 54 | $disabled, 55 | $extra, 56 | $id, 57 | $readonly, 58 | $required, 59 | $label_value 60 | ); 61 | } 62 | -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-email.php: -------------------------------------------------------------------------------- 1 | ", 40 | $name, 41 | $value, 42 | $class, 43 | $placeholder, 44 | $disabled, 45 | $extra, 46 | $id, 47 | $readonly, 48 | $required 49 | ); 50 | } 51 | -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-hidden.php: -------------------------------------------------------------------------------- 1 | ", 30 | $name, 31 | $value, 32 | $class, 33 | $placeholder, 34 | $disabled, 35 | $extra, 36 | $id, 37 | $readonly, 38 | $required 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-multiline.php: -------------------------------------------------------------------------------- 1 | %s", 44 | $name, 45 | $rows, 46 | $cols, 47 | $class, 48 | $placeholder, 49 | $disabled, 50 | $extra, 51 | $id, 52 | $readonly, 53 | $required, 54 | wp_kses_post( $value ) 55 | ); 56 | } 57 | -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-number.php: -------------------------------------------------------------------------------- 1 | ", 45 | $name, 46 | $value, 47 | $class, 48 | $placeholder, 49 | $min, 50 | $max, 51 | $step, 52 | $disabled, 53 | $extra, 54 | $id, 55 | $readonly, 56 | $required 57 | ); 58 | } 59 | -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-password.php: -------------------------------------------------------------------------------- 1 | ", 31 | $name, 32 | $class, 33 | $placeholder, 34 | $disabled, 35 | $extra, 36 | $id, 37 | $readonly, 38 | $required 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-radio.php: -------------------------------------------------------------------------------- 1 | '; 42 | foreach ( $options as $key => $label ) { 43 | $checked = checked( $value, $key, false ); 44 | $html .= sprintf( 45 | " 46 |
47 | 48 |
49 | ", 50 | $disabled, 51 | $key, 52 | $name, 53 | $key, 54 | $class, 55 | $checked, 56 | $extra, 57 | $disabled, 58 | $id, 59 | $readonly, 60 | $required, 61 | $label 62 | ); 63 | } 64 | 65 | return $html; 66 | } 67 | -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-select.php: -------------------------------------------------------------------------------- 1 | $label ) { 56 | if ( is_array( $value ) ) { 57 | $checked = in_array( $key, $value ) ? 'selected' : ''; 58 | $option .= ''; 59 | } elseif ( is_serialized( $value ) ) { 60 | $checked = in_array( $key, maybe_unserialize( $value ) ) ? 'selected' : ''; 61 | $option .= ''; 62 | } else { 63 | $option .= ''; 68 | } 69 | } 70 | 71 | return sprintf( 72 | " 73 | ", 76 | $select_name, 77 | $class, 78 | $multi_select, 79 | $disabled, 80 | $extra, 81 | $id, 82 | $required, 83 | $option 84 | ); 85 | } 86 | -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-singleline.php: -------------------------------------------------------------------------------- 1 | ", 41 | $name, 42 | $value, 43 | $class, 44 | $placeholder, 45 | $disabled, 46 | $extra, 47 | $id, 48 | $readonly, 49 | $required 50 | ); 51 | } 52 | -------------------------------------------------------------------------------- /includes/admin/fields/fed-form-url.php: -------------------------------------------------------------------------------- 1 | ", 42 | $name, 43 | $value, 44 | $class, 45 | $placeholder, 46 | $disabled, 47 | $extra, 48 | $id, 49 | $readonly, 50 | $required 51 | ); 52 | } 53 | -------------------------------------------------------------------------------- /includes/admin/fields/index.php: -------------------------------------------------------------------------------- 1 | 17 |
18 |
19 | 24 | 25 | 26 | 27 | 33 | 34 | 40 | 41 | . 42 |
43 |
44 | 19 |
20 |
23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 |

32 | 33 |

34 |
35 |
36 |
37 | 38 |
39 | 40 | 41 |
42 | 43 |
44 | 45 |
46 | 47 |
48 |
49 | 54 | 55 |
56 |
57 | 59 | 61 |
62 |
63 | 67 |
68 |
69 |
70 |
71 |
72 |
73 | 18 | 19 | $row['placeholder'] ), 'single_line' ); ?> 20 | 30 | 31 | $row['class_name'] ), 'single_line' ); ?> 32 | 42 | 43 | $row['id_name'] ), 'single_line' ); ?> 44 | 20 |
21 |
24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
32 |

33 | 34 |

35 |
36 |
37 |
38 | 39 |
40 | 41 | 42 |
43 | 44 |
45 |
46 |
47 |
48 | 49 |
50 | 51 |
52 | 53 |
54 |
55 | 56 | 63 |
64 |
65 |
66 |
67 |
68 |
69 | 20 |
21 |
24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
32 |

33 | 34 |

35 |
36 |
37 |
38 | 39 | 40 | 41 |
42 | 43 | 44 |
45 | 46 |
47 |
48 |
49 |
50 | 51 |
52 | 53 |
54 | 55 |
56 |
57 |
58 |
59 | 60 | $row['input_min'] ), 61 | 'number' ); ?> 62 |
63 | 64 |
65 | 66 | $row['input_max'] ), 67 | 'number' ); ?> 68 |
69 | 70 |
71 | 73 | $row['input_step'] ), 74 | 'number' ); ?> 75 |
76 |
77 | 78 | 79 | 86 |
87 |
88 |
89 |
90 |
91 |
92 | 20 |
21 |
24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
32 |

33 | 34 |

35 |
36 |
37 |
38 | 39 |
40 | 41 | 42 |
43 | 44 |
45 |
46 |
47 |
48 | 49 |
50 | 51 |
52 | 53 |
54 |
55 | 62 |
63 |
64 |
65 |
66 |
67 |
68 | 19 |
20 |
23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 |

32 | 33 |

34 |
35 |
36 |
37 | 40 |
41 | 42 | 43 |
44 | 45 |
46 | 47 |
48 | 49 |
50 | 51 |
52 | 57 | 58 |
59 |
60 | 61 | __( 'Please enter the value by key,value', 63 | 'frontend-dashboard' ), 64 | 'rows' => 10, 65 | 'value' => $row['input_value'], 66 | ), 'multi_line' ); ?> 67 |
68 |
69 |
70 |
71 | 72 |

key,value|one,One|two,Two|five-category,Five Category

73 |
74 |
75 | 76 |

77 | 'Value', 80 | 'one' => 'One', 81 | 'two' => 'Two', 82 | 'five-category' => 'Five Category', 83 | ); 84 | echo fed_input_box( 'fed_dummy_radio', array( 'options' => $value ), 85 | 'radio' ); 86 | ?> 87 |
88 |
89 |
90 |
91 | 92 | 95 |
96 |
97 |
98 |
99 |
100 |
101 | 19 |
20 |
23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 |

32 | 33 |

34 |
35 |
36 |
37 | 38 |
39 | 40 | 41 |
42 | 43 |
44 |
45 |
46 |
47 | 48 |
49 | 50 |
51 | 52 |
53 |
54 | 61 |
62 |
63 |
64 |
65 |
66 |
67 | 20 |
21 |
24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
32 |

33 | 34 |

35 |
36 |
37 |
38 | 39 |
40 | 41 | 42 |
43 | 44 |
45 |
46 |
47 |
48 | 49 |
50 | 51 |
52 | 53 |
54 | 55 |
56 | 57 | $row['input_row'] ), 58 | 'single_line' ); ?> 59 |
60 |
61 | 68 |
69 |
70 |
71 |
72 |
73 |
74 | 19 |
20 |
23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 |

32 | 33 |

34 |
35 |
36 |
37 | 38 |
39 | 40 | 41 |
42 | 43 |
44 |
45 |
46 |
47 | 48 |
49 | 50 |
51 | 52 |
53 |
54 | 61 |
62 |
63 |
64 |
65 |
66 |
67 | ID ); 34 | ?> 35 |
36 | 44 |
45 |
46 |
47 | 48 |
49 |
50 | 54 |
55 | post_type ); 77 | 78 | /* Check if the current user has permission to edit the post. */ 79 | if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) ) { 80 | return $post_id; 81 | } 82 | 83 | /** 84 | * Get all post meta key 85 | */ 86 | $post_meta = fed_fetch_table_rows_with_key( BC_FED_TABLE_POST, 'input_meta' ); 87 | /** 88 | * Check with post meta to save the meta 89 | */ 90 | if ( count( $post_meta ) > 0 ) { 91 | foreach ( $post_meta as $index => $extra ) { 92 | if ( isset( $post_payload['fed_meta'] ) ) { 93 | if ( array_key_exists( $index, $post_payload['fed_meta'] ) ) { 94 | $meta_value = isset( $post_payload['fed_meta'][ $index ] ) ? sanitize_text_field( $post_payload['fed_meta'][ $index ] ) : ''; 95 | update_post_meta( $post_id, $index, $meta_value ); 96 | } else { 97 | /** 98 | * Delete the unwanted post metas 99 | */ 100 | delete_post_meta( $post_id, $index ); 101 | } 102 | } 103 | } 104 | } 105 | } 106 | 107 | /** 108 | * Remove Post Custom Meta Default Fields 109 | */ 110 | function fed_remove_post_custom_fields() { 111 | remove_meta_box( 'postcustom', 'post', 'normal' ); 112 | } 113 | 114 | add_action( 'admin_menu', 'fed_remove_post_custom_fields' ); 115 | -------------------------------------------------------------------------------- /includes/admin/layout/settings_tab/email/index.php: -------------------------------------------------------------------------------- 1 | array( 19 | 'method' => '', 20 | 'class' => 'fed_admin_menu fed_ajax', 21 | 'attr' => '', 22 | 'action' => array( 23 | 'url' => '', 24 | 'action' => 'fed_ajax_request', 25 | 'parameters' => array( 26 | 'fed_action_hook_fn' => 'fed_admin_frontend_login_menu_save', 27 | ), 28 | ), 29 | 'nonce' => array( 30 | 'action' => '', 31 | 'name' => '', 32 | ), 33 | 'loader' => '', 34 | ), 35 | 'input' => array( 36 | 'Assign Login Menu' => array( 37 | 'col' => 'col-md-7', 38 | 'name' => __( 'Assign Login Menu', 'frontend-dashboard' ), 39 | 'input' => fed_get_input_details( 40 | array( 41 | 'input_meta' => 'menu_item', 42 | 'input_value' => 43 | array( 44 | '' => __( 'Please Select', 'frontend-dashboard' ), 45 | ) + get_registered_nav_menus(), 46 | 'user_value' => isset( $fed_login_register['login_menu']['menu_item'] ) ? $fed_login_register['login_menu']['menu_item'] : '', 47 | 'input_type' => 'select', 48 | ) 49 | ), 50 | 'help_message' => fed_show_help_message( 51 | array( 52 | 'content' => __( 53 | 'Select the respective menu items to show the Login, Logout and Dashboard Menu Items', 54 | 'frontend-dashboard' 55 | ), 56 | ) 57 | ), 58 | ), 59 | ), 60 | ); 61 | 62 | fed_common_simple_layout( $array ); 63 | } 64 | 65 | /** 66 | * Save Login Menu. 67 | * 68 | * @param array $request Request. 69 | */ 70 | function fed_admin_frontend_login_menu_save( $request ) { 71 | $fed_login = get_option( 'fed_admin_login' ); 72 | 73 | $fed_login['login_menu']['menu_item'] = fed_get_data( 'menu_item', $request ); 74 | 75 | update_option( 'fed_admin_login', $fed_login ); 76 | 77 | wp_send_json_success( array( 'message' => __( 'Login menu successfully assigned' ) ) ); 78 | 79 | } 80 | -------------------------------------------------------------------------------- /includes/admin/layout/settings_tab/login/index.php: -------------------------------------------------------------------------------- 1 | 19 |
20 |
21 | 41 |
42 |
43 | 44 |
45 | $tab ) { 48 | $active = ( 0 === $content_count ) ? 'active' : ''; 49 | $content_count ++; 50 | ?> 51 |
54 |
55 |
56 |

57 | 58 | 59 |

60 |
61 |
62 | 65 |
66 |
67 |
68 | 69 |
70 |
71 |
72 | 73 | array( 87 | 'icon' => 'fa fa-cogs', 88 | 'name' => __( 'Settings', 'frontend-dashboard' ), 89 | 'callable' => 'fed_admin_login_settings_tab', 90 | 'arguments' => $fed_login, 91 | ), 92 | 'fed_admin_register_settings' => array( 93 | 'icon' => 'fas fa-door-open', 94 | 'name' => __( 'Register', 'frontend-dashboard' ), 95 | 'callable' => 'fed_admin_register_settings_tab', 96 | 'arguments' => $fed_login, 97 | ), 98 | 'fed_admin_restrict_wp_admin' => array( 99 | 'icon' => 'fa fa-user-secret', 100 | 'name' => __( 'Restrict WP Admin Area', 'frontend-dashboard' ), 101 | 'callable' => 'fed_admin_restrict_wp_admin_tab', 102 | 'arguments' => $fed_login, 103 | ), 104 | 'fed_admin_username_restrict' => array( 105 | 'icon' => 'fa fa-ban', 106 | 'name' => __( 'Restrict Username', 'frontend-dashboard' ), 107 | 'callable' => 'fed_admin_username_restrict_tab', 108 | 'arguments' => $fed_login, 109 | ), 110 | 'fed_admin_frontend_login_menu' => array( 111 | 'icon' => 'fa fa-align-justify', 112 | 'name' => __( 'Frontend Login Menu', 'frontend-dashboard' ), 113 | 'callable' => 'fed_admin_frontend_login_menu_tab', 114 | 'arguments' => $fed_login, 115 | ), 116 | ) 117 | ); 118 | } 119 | -------------------------------------------------------------------------------- /includes/admin/layout/settings_tab/login/register-tab.php: -------------------------------------------------------------------------------- 1 | array( 25 | 'method' => '', 26 | 'class' => 'fed_admin_menu fed_ajax', 27 | 'attr' => '', 28 | 'action' => array( 29 | 'url' => '', 30 | 'action' => 'fed_admin_setting_form', 31 | ), 32 | 'nonce' => array( 33 | 'action' => '', 34 | 'name' => '', 35 | ), 36 | 'loader' => '', 37 | ), 38 | 'hidden' => array( 39 | 'fed_admin_unique' => array( 40 | 'input_type' => 'hidden', 41 | 'user_value' => 'fed_login_details', 42 | 'input_meta' => 'fed_admin_unique', 43 | ), 44 | 'fed_admin_unique_login' => array( 45 | 'input_type' => 'hidden', 46 | 'user_value' => 'fed_register_settings', 47 | 'input_meta' => 'fed_admin_unique_login', 48 | ), 49 | ), 50 | 'input' => array( 51 | 'Menu Name' => array( 52 | 'col' => 'col-md-6', 53 | 'name' => 'Menu Name', 54 | 'input' => fed_get_input_details( 55 | array( 56 | 'placeholder' => '(eg) User Role', 57 | 'input_meta' => 'fed_admin_login[name]', 58 | 'user_value' => $name, 59 | 'input_type' => 'single_line', 60 | 'required' => true, 61 | ) 62 | ), 63 | ), 64 | 'Menu Name Order' => array( 65 | 'col' => 'col-md-6', 66 | 'name' => 'Menu Name Order', 67 | 'input' => fed_get_input_details( 68 | array( 69 | 'placeholder' => '(eg) 40', 70 | 'input_meta' => 'fed_admin_login[position]', 71 | 'user_value' => $position, 72 | 'input_type' => 'number', 73 | 'required' => true, 74 | ) 75 | ), 76 | ), 77 | 'Auto Login' => array( 78 | 'col' => 'col-md-6', 79 | 'name' => 'Auto Login after Register?', 80 | 'input' => fed_get_input_details( 81 | array( 82 | 'input_meta' => 'fed_admin_login[auto_login]', 83 | 'user_value' => $auto_login, 84 | 'input_type' => 'select', 85 | 'input_value' => array( '' => 'Please Select' ) + fed_yes_no(), 86 | ) 87 | ), 88 | ), 89 | 'Email Notification after Register' => array( 90 | 'col' => 'col-md-6', 91 | 'name' => 'Email Notification after Register', 92 | 'input' => fed_get_input_details( 93 | array( 94 | 'input_meta' => 'fed_admin_login[register_email_notification]', 95 | 'user_value' => fed_get_data( 'register.register_email_notification', $fed_login_register ), 96 | 'input_type' => 'select', 97 | 'input_value' => array( 98 | '' => 'Please Select', 99 | 'user' => 'Only User', 100 | 'admin' => 'Only Admin', 101 | 'both' => 'Both User and Admin', 102 | ), 103 | ) 104 | ), 105 | ), 106 | 'sur' => array( 107 | 'col' => 'col-md-12', 108 | 'header' => 'Show User Role(s) in Register Form', 109 | 'sub_col' => 'col-md-4', 110 | ), 111 | ), 112 | 'note' => array( 113 | 'header' => '', 114 | 'footer' => '', 115 | ), 116 | ); 117 | 118 | foreach ( $user_roles as $key => $role ) { 119 | $c_value = in_array( $key, $user_role, false ) ? 'Enable' : 'Disable'; 120 | $array['input']['sur']['extra']['input'][ $key ] = array( 121 | 'input_meta' => 'fed_admin_login[role][' . $key . ']', 122 | 'user_value' => $c_value, 123 | 'input_type' => 'checkbox', 124 | 'label' => $role, 125 | 'default_value' => 'Enable', 126 | ); 127 | } 128 | 129 | apply_filters( 'fed_admin_login_register_template', $array, $fed_login_register ); 130 | 131 | fed_common_simple_layout( $array ); 132 | 133 | } 134 | -------------------------------------------------------------------------------- /includes/admin/layout/settings_tab/login/restrict-username.php: -------------------------------------------------------------------------------- 1 | array( 20 | 'method' => '', 21 | 'class' => 'fed_admin_menu fed_ajax', 22 | 'attr' => '', 23 | 'action' => array( 24 | 'url' => '', 25 | 'action' => 'fed_admin_setting_form', 26 | ), 27 | 'nonce' => array( 28 | 'action' => '', 29 | 'name' => '', 30 | ), 31 | 'loader' => '', 32 | ), 33 | 'hidden' => array( 34 | 'fed_admin_unique' => array( 35 | 'input_type' => 'hidden', 36 | 'user_value' => 'fed_login_details', 37 | 'input_meta' => 'fed_admin_unique', 38 | ), 39 | 'fed_admin_unique_login' => array( 40 | 'input_type' => 'hidden', 41 | 'user_value' => 'fed_restrict_username', 42 | 'input_meta' => 'fed_admin_unique_login', 43 | ), 44 | ), 45 | 'input' => array( 46 | 'Restrict Username' => array( 47 | 'col' => 'col-md-12', 48 | 'name' => __( 'Restrict Username', 'frontend-dashboard' ), 49 | 'input' => fed_get_input_details( 50 | array( 51 | 'input_meta' => 'fed_admin_login[restrict_username]', 52 | 'user_value' => isset( $fed_login_register['restrict_username'] ) ? $fed_login_register['restrict_username'] : '', 53 | 'input_type' => 'multi_line', 54 | 'placeholder' => 'Add Restrictive User Name by Comma Separated like ban,admin,support', 55 | ) 56 | ), 57 | 'help_message' => fed_show_help_message( array( 'content' => 'Add Restrictive User Name by Comma Separated' ) ), 58 | ), 59 | ), 60 | 'note' => array( 61 | 'header' => '', 62 | 'footer' => 'Add Restrictive User Name by Comma Separated', 63 | ), 64 | ); 65 | 66 | fed_common_simple_layout( $array ); 67 | } 68 | -------------------------------------------------------------------------------- /includes/admin/layout/settings_tab/login/restrict-wp-tab.php: -------------------------------------------------------------------------------- 1 | array( 23 | 'method' => '', 24 | 'class' => 'fed_admin_menu fed_ajax', 25 | 'attr' => '', 26 | 'action' => array( 27 | 'url' => '', 28 | 'action' => 'fed_admin_setting_form', 29 | ), 30 | 'nonce' => array( 31 | 'action' => '', 32 | 'name' => '', 33 | ), 34 | 'loader' => '', 35 | ), 36 | 'hidden' => array( 37 | 'fed_admin_unique' => array( 38 | 'input_type' => 'hidden', 39 | 'user_value' => 'fed_login_details', 40 | 'input_meta' => 'fed_admin_unique', 41 | ), 42 | 'fed_admin_unique_login' => array( 43 | 'input_type' => 'hidden', 44 | 'user_value' => 'fed_wp_restrict_settings', 45 | 'input_meta' => 'fed_admin_unique_login', 46 | ), 47 | ), 48 | 'input' => array( 49 | 'sur' => array( 50 | 'col' => 'col-md-12', 51 | 'header' => 'Restrict User Role(s) to access the WP admin area', 52 | 'sub_col' => 'col-md-4', 53 | ), 54 | ), 55 | 'note' => array( 56 | 'header' => '', 57 | 'footer' => '', 58 | ), 59 | ); 60 | 61 | foreach ( $user_roles as $key => $role ) { 62 | $c_value = in_array( $key, $user_role, false ) ? 'Enable' : 'Disable'; 63 | $array['input']['sur']['extra']['input'][ $key ] = array( 64 | 'input_meta' => 'fed_admin_login[role][' . $key . ']', 65 | 'user_value' => $c_value, 66 | 'input_type' => 'checkbox', 67 | 'label' => $role, 68 | 'default_value' => 'Enable', 69 | ); 70 | } 71 | 72 | apply_filters( 'fed_admin_login_wp_restrict_template', $array, $fed_login_register ); 73 | 74 | fed_common_simple_layout( $array ); 75 | } 76 | -------------------------------------------------------------------------------- /includes/admin/layout/settings_tab/post/index.php: -------------------------------------------------------------------------------- 1 | 19 |
22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 34 |
35 |
36 |
37 |
Post Menu Name
38 |
39 | 'fed_post_options[menu][rename_post]', 44 | 'placeholder' => __( 'Please enter new name for Post' ), 45 | 'value' => isset( $fed_admin_options['menu']['rename_post'] ) ? $fed_admin_options['menu']['rename_post'] : 'Post', 46 | ), 'single_line' 47 | ) 48 | ?> 49 |
50 |
51 |
52 |
Post Menu Position
53 |
54 | 'fed_post_options[menu][post_position]', 59 | 'value' => isset( $fed_admin_options['menu']['post_position'] ) ? $fed_admin_options['menu']['post_position'] : 2, 60 | 'placeholder' => __( 'Post Menu Position' ), 61 | ), 'number' 62 | ); 63 | ?> 64 |
65 |
66 |
67 |
Post Menu Icon
68 |
69 | 'fed_post_options[menu][post_menu_icon]', 74 | 'placeholder' => __( 'Please Select Post Menu Icon' ), 75 | 'value' => isset( $fed_admin_options['menu']['post_menu_icon'] ) ? $fed_admin_options['menu']['post_menu_icon'] : 'fa fa-file-text', 76 | 'class' => 'post_menu_icon', 77 | 'extra' => 'data-toggle="modal" data-target=".fed_show_fa_list" placeholder="Menu Icon" data-fed_menu_box_id="post_menu_icon"', 78 | ), 'single_line' 79 | ) 80 | ?> 81 |
82 |
83 |
84 |
85 | 86 |
87 |
88 | 89 |
90 |
91 | 92 |
93 | 23 | 24 |
27 | 28 | 29 | 30 | 31 | 32 | 35 | 38 | 39 |
40 |
41 |
42 |
Allow User Roles to Add/Edit/Delete Posts
43 |
44 | $role ) { 46 | $c_value = in_array( $key, $post_permission ) ? 'Enable' : 'Disable'; 47 | ?> 48 |
49 | 'Enable', 54 | 'name' => 'permissions[post_permission][' . $key . ']', 55 | 'label' => $role, 56 | 'value' => $c_value, 57 | ), 'checkbox' 58 | ); 59 | ?> 60 |
61 | 64 | 65 |
66 |
67 |
68 |
Allow User Roles to Upload Files
69 |
70 | $role ) { 72 | $c_value = in_array( $key, $fed_upload_permission ) ? 'Enable' : 'Disable'; 73 | ?> 74 |
75 | 'Enable', 80 | 'name' => 'permissions[fed_upload_permission][' . $key . ']', 81 | 'label' => $role, 82 | 'value' => $c_value, 83 | ), 'checkbox' 84 | ); 85 | ?> 86 |
87 | 90 | 91 |
92 |
93 |
94 |
95 | 96 |
97 |
98 | 99 |
100 |
101 |
102 | $all_role ) { 115 | $default['permissions']['post_permission'][ $key ] = 'Enable'; 116 | $default['permissions']['fed_upload_permission'][ $key ] = 'Enable'; 117 | } 118 | $default['settings']['fed_post_status'] = 'publish'; 119 | $default['menu']['rename_post'] = 'Post'; 120 | $default['menu']['post_position'] = 2; 121 | $default['menu']['post_menu_icon'] = 'fa fa-file-text'; 122 | 123 | return $default; 124 | } 125 | -------------------------------------------------------------------------------- /includes/admin/layout/settings_tab/post/post-tab.php: -------------------------------------------------------------------------------- 1 | 16 |
17 |
18 |
19 | 20 | Please install 21 | 22 | Frontend Dashboard Custom Post and Taxonomies 23 | 24 | Plugin to customise it 25 |
26 |
27 |
28 | array( 43 | 'icon' => 'fa fa-cogs', 44 | 'name' => __( 'Settings', 'frontend-dashboard' ), 45 | 'callable' => 'fed_admin_post_settings_tab', 46 | 'arguments' => $fed_admin_options, 47 | ), 48 | 'fed_admin_post_dashboard' => array( 49 | 'icon' => 'fa fa-cog', 50 | 'name' => __( 'Dashboard Settings', 'frontend-dashboard' ), 51 | 'callable' => 'fed_admin_post_dashboard_tab', 52 | 'arguments' => $fed_admin_options, 53 | ), 54 | 'fed_admin_post_menu' => array( 55 | 'icon' => 'fa fa-list', 56 | 'name' => __( 'Menu', 'frontend-dashboard' ), 57 | 'callable' => 'fed_admin_post_menu_tab', 58 | 'arguments' => $fed_admin_options, 59 | ), 60 | 'fed_admin_post_permissions' => array( 61 | 'icon' => 'fa fa-universal-access', 62 | 'name' => __( 'Permissions', 'frontend-dashboard' ), 63 | 'callable' => 'fed_admin_post_permissions_tab', 64 | 'arguments' => $fed_admin_options, 65 | ), 66 | ) 67 | ); 68 | } 69 | -------------------------------------------------------------------------------- /includes/admin/layout/settings_tab/post/settings.php: -------------------------------------------------------------------------------- 1 | 22 |
25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 37 | 38 | 39 |
40 |
41 | 42 | 43 |
44 |
New Post Status
45 |
46 |
47 | 'settings[fed_post_status]', 52 | 'value' => $fed_post_status, 53 | 'options' => $post_status, 54 | ), 'select' 55 | ); 56 | ?> 57 |
58 |
59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 67 |
68 |
69 |
70 | 20 |
23 | 24 | 25 | 26 | 27 | 30 | 33 | 34 |
35 |
36 |
37 |
38 | 39 |
40 |
41 |
42 |
43 | 46 | 'user[role][role_name]', 51 | 'id' => 'fed_admin_post_user_role_name', 52 | 'placeholder' => __( 'Role Name', 'frontend-dashboard' ), 53 | 'required' => 'true', 54 | ), 'single_line' 55 | ) 56 | ?> 57 |
58 |
59 | 62 | 'user[role][role_slug]', 67 | 'id' => 'fed_admin_post_user_role_slug', 68 | 'placeholder' => __( 'Role Slug', 'frontend-dashboard' ), 69 | 'required' => 'true', 70 | ), 'single_line' 71 | ) 72 | ?> 73 |
74 |
75 | 79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | 87 |
88 |
89 |
90 | $user_role ) { 95 | ?> 96 | 122 | 126 |
127 |
128 | 19 |
20 |
21 | 42 |
43 |
44 | 45 |
46 | $tab ) { 49 | $active = ( 0 === $content_count ) ? 'active' : ''; 50 | $content_count ++; 51 | ?> 52 |
55 | 58 |
59 | 60 |
61 |
62 |
63 | array( 78 | 'icon' => 'fa fa-user-plus', 79 | 'name' => __( 'Add/Delete Custom Role', 'frontend-dashboard' ), 80 | 'callable' => 'fed_admin_user_role_tab', 81 | 'arguments' => $fed_admin_options, 82 | ), 83 | 'fed_admin_user_upload_permission' => array( 84 | 'icon' => 'fa fa-upload', 85 | 'name' => __( 'User Upload Permission', 'frontend-dashboard' ), 86 | 'callable' => 'fed_admin_user_upload_permission_tab', 87 | 'arguments' => $fed_admin_options, 88 | ), 89 | ), 90 | $fed_admin_options 91 | ); 92 | } 93 | -------------------------------------------------------------------------------- /includes/admin/layout/settings_tab/user/user-upload.php: -------------------------------------------------------------------------------- 1 | 22 | 23 |
26 | 27 | 28 | 29 | 30 | 31 | 34 | 37 | 38 |
39 |
40 |
41 |
42 |
43 |
44 |

45 | 46 | 47 |

48 |
49 |
50 |
51 | 54 |
55 | $role ) { 57 | $c_value = in_array( $key, $fed_upload_permission, false ) ? 'Enable' : 'Disable'; 58 | ?> 59 |
60 | 'Enable', 65 | 'name' => 'user[upload_permission][' . $key . ']', 66 | 'label' => $role, 67 | 'value' => $c_value, 68 | ), 'checkbox' 69 | ); 70 | ?> 71 |
72 | 75 |
76 | 77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | array( 31 | 'icon' => 'fa fa-cogs', 32 | 'name' => __( 'Settings', 'frontend-dashboard' ), 33 | 'callable' => 'fed_admin_user_profile_settings_tab', 34 | 'arguments' => $fed_admin_options, 35 | ), 36 | 'fed_admin_user_profile_layout_colors' => array( 37 | 'icon' => 'fa fa-paint-brush', 38 | 'name' => __( 'Colors', 'frontend-dashboard' ), 39 | 'callable' => 'fed_admin_user_profile_colors_tab', 40 | 'arguments' => $fed_admin_options, 41 | ), 42 | ); 43 | 44 | return apply_filters( 'fed_customize_admin_user_profile_layout_options', $options, $fed_admin_options ); 45 | } 46 | -------------------------------------------------------------------------------- /includes/admin/menu/index.php: -------------------------------------------------------------------------------- 1 | 0 ) { 24 | $settings = get_option( 'fed_payment_settings' ); 25 | ?> 26 |
37 | 38 |
39 | $template ) { 41 | ?> 42 |
43 |
44 |
45 |

46 |
47 |
48 | 50 |
51 | 56 |
57 |
58 | 59 | 64 | 65 |
66 |
67 |
68 |
69 | 72 |
73 | 76 |
77 | pro(); 82 | } 83 | } 84 | 85 | /** 86 | * Update. 87 | * 88 | * @param array $request Request. 89 | */ 90 | public function update( $request ) { 91 | $validate = new FED_Validation(); 92 | $validate->name( 'Template' )->value( $request['template'] )->required(); 93 | 94 | if ( ! $validate->is_success() ) { 95 | $errors = implode( '
', $validate->get_errors() ); 96 | wp_send_json_error( array( 'message' => $errors ) ); 97 | } 98 | $settings = get_option( 'fed_payment_settings' ); 99 | $settings['invoice']['template']['default'] = fed_sanitize_text_field( $request['template'] ); 100 | update_option( 'fed_payment_settings', $settings ); 101 | 102 | wp_send_json_success( array( 'message' => __( 'Invoice Template Successfully Updated' ) ) ); 103 | 104 | } 105 | } 106 | } -------------------------------------------------------------------------------- /includes/admin/payment/class-fed-payment-widgets.php: -------------------------------------------------------------------------------- 1 | prefix . BC_FED_TABLE_PAYMENT; 42 | $query = "SELECT DATE_FORMAT(created,'%Y-%m-%d') as created, currency, SUM(amount) as amount FROM $table GROUP BY DATE_FORMAT(created,'%Y-%m-%d')"; 43 | $currency = 'USD'; 44 | 45 | $payments = $wpdb->get_results( $query, ARRAY_A ); 46 | 47 | if ( $payments && count( $payments ) > 0 ) { 48 | foreach ( $payments as $index => $payment ) { 49 | $currency = $payment['currency']; 50 | $created[ $index ] = $payment['created']; 51 | $amount[ $index ] = $payment['amount']; 52 | } 53 | ?> 54 |
55 | 56 |
57 | 80 | settings_data(); 29 | fed_common_simple_layout( $settings ); 30 | } 31 | 32 | /** 33 | * Setting Data 34 | * 35 | * @return mixed|void. 36 | * 37 | * Options => fed_payment_settings 38 | */ 39 | public function settings_data() { 40 | $settings = get_option( 'fed_payment_settings' ); 41 | $array = array( 42 | 'form' => array( 43 | 'method' => '', 44 | 'class' => 'fed_admin_menu fed_ajax', 45 | 'attr' => '', 46 | 'action' => array( 47 | 'url' => '', 48 | 'action' => 'fed_ajax_request', 49 | 'parameters' => array( 50 | 'fed_action_hook' => 'FEDPayment', 51 | ), 52 | ), 53 | 'nonce' => array( 54 | 'action' => '', 55 | 'name' => '', 56 | ), 57 | 'loader' => '', 58 | ), 59 | 'input' => array( 60 | 'Enable Payment' => array( 61 | 'col' => 'col-md-7', 62 | 'name' => __( 'Gateway', 'frontend-dashboard' ), 63 | 'input' => 64 | fed_get_input_details( 65 | array( 66 | 'input_meta' => 'settings[gateway]', 67 | 'user_value' => isset( $settings['settings']['gateway'] ) ? esc_attr( 68 | $settings['settings']['gateway'] 69 | ) : 'disable', 70 | 'input_type' => 'radio', 71 | 'class_name' => 'm-r-10', 72 | 'input_value' => fed_get_payment_gateways(), 73 | ) 74 | ), 75 | 'help_message' => fed_show_help_message( 76 | array( 77 | 'content' => __( 78 | 'By Checking this, you are enabling the Payment', 79 | 'frontend-dashboard' 80 | ), 81 | ) 82 | ), 83 | ), 84 | ), 85 | ); 86 | 87 | return apply_filters( 'fed_payment_settings', $array, $settings ); 88 | } 89 | 90 | /** 91 | * @param $menu 92 | * 93 | * @return array 94 | */ 95 | public function main_sub_menu( $menu ) { 96 | $menu['fed_payments'] = array( 97 | 'page_title' => __( 'Payments', 'frontend-dashboard' ), 98 | 'menu_title' => __( 'Payments', 'frontend-dashboard' ), 99 | 'capability' => 'manage_options', 100 | 'callback' => array( new FEDPaymentMenu(), 'index' ), 101 | 'position' => 30, 102 | ); 103 | 104 | return $menu; 105 | } 106 | 107 | /** 108 | * Update. 109 | * 110 | * @param array $request Request. 111 | */ 112 | public function update( $request ) { 113 | 114 | $this->authorize(); 115 | 116 | $this->validation(); 117 | 118 | $settings = get_option( 'fed_payment_settings' ); 119 | 120 | $settings['settings']['gateway'] = isset( $request['settings']['gateway'] ) ? fed_sanitize_text_field( 121 | $request['settings']['gateway'] 122 | ) : 'disable'; 123 | 124 | update_option( 'fed_payment_settings', $settings ); 125 | 126 | wp_send_json_success( 127 | array( 'message' => __( 'Payment Settings Successfully Saved', 'frontend-dashboard' ) ) 128 | ); 129 | } 130 | 131 | /** 132 | * Validation. 133 | */ 134 | private function validation() { 135 | $validate = new FED_Validation(); 136 | 137 | $validate->name( 'Payment Gateway' )->value( fed_get_data( 'settings.gateway' ) )->required(); 138 | 139 | if ( ! $validate->is_success() ) { 140 | $errors = implode( '
', $validate->get_errors() ); 141 | wp_send_json_error( array( 'message' => $errors ) ); 142 | } 143 | } 144 | 145 | /** 146 | * Authorize. 147 | */ 148 | public function authorize() { 149 | if ( ! fed_is_admin() ) { 150 | wp_die( 151 | __( 152 | 'Sorry! You are not allowed to do this action | Error: FED|Admin|Payment|FEDPayment@authorize' 153 | ) 154 | ); 155 | } 156 | 157 | } 158 | } 159 | 160 | new FEDPayment(); 161 | } 162 | -------------------------------------------------------------------------------- /includes/admin/payment/index.php: -------------------------------------------------------------------------------- 1 | 'fab fa-cc-stripe', 34 | 'name' => 'Stripe', 35 | 'menu' => array( 'FEDPPPRO@stripe' ), 36 | ); 37 | $menu['gateway']['submenu']['FEDPPPRO@braintree'] = array( 38 | 'icon' => 'fas fa-money-check-alt', 39 | 'name' => 'Braintree', 40 | 'menu' => array( 'FEDPPPRO@braintree' ), 41 | ); 42 | 43 | $menu['email'] = array( 44 | 'icon' => 'fa fa-envelope', 45 | 'name' => __( 'Email', 'frontend-dashboard' ), 46 | 'submenu' => array( 47 | 'FEDPPPRO@templates' => array( 48 | 'icon' => 'fa fa-paint-brush', 49 | 'name' => __( 'Templates', 'frontend-dashboard' ), 50 | 'menu' => array( 'FEDPPPRO@templates' ), 51 | ), 52 | ), 53 | ); 54 | 55 | return $menu; 56 | } 57 | 58 | /** 59 | * Stripe. 60 | */ 61 | public function stripe() { 62 | $this->pro(); 63 | } 64 | 65 | /** 66 | * Braintree. 67 | */ 68 | public function braintree() { 69 | $this->pro(); 70 | } 71 | 72 | /** 73 | * Templates. 74 | */ 75 | public function templates() { 76 | $this->pro(); 77 | } 78 | 79 | /** 80 | * Pro. 81 | */ 82 | public function pro() { 83 | ?> 84 |
85 |
86 |
87 | 88 | 89 | 90 | 91 | 92 | 93 | 109 |
110 |
111 |
112 |
113 | 114 | 115 | 116 | 117 | 118 | 119 | 135 |
136 |
137 |
138 | 139 |
140 |
141 |

142 | For More Information, Please visit - 143 | Frontend Dashboard 145 | Payment Pro 146 | 147 |

148 |
149 |
150 | 151 | isset( $request['settings']['fed_upl_change_profile_pic'] ) ? sanitize_text_field( 19 | $request['settings']['fed_upl_change_profile_pic'] 20 | ) : '', 21 | 'fed_upl_disable_desc' => isset( $request['settings']['fed_upl_disable_desc'] ) ? sanitize_text_field( 22 | $request['settings']['fed_upl_disable_desc'] 23 | ) : '', 24 | 'fed_upl_no_recent_post' => isset( $request['settings']['fed_upl_no_recent_post'] ) ? (int) $request['settings']['fed_upl_no_recent_post'] : '5', 25 | 'fed_upl_collapse_menu' => isset( $request['settings']['fed_upl_collapse_menu'] ) ? $request['settings']['fed_upl_collapse_menu'] : null, 26 | 'fed_upl_disable_logout' => isset( $request['settings']['fed_upl_disable_logout'] ) ? $request['settings']['fed_upl_disable_logout'] : null, 27 | 'fed_upl_disable_collapse_menu' => isset( $request['settings']['fed_upl_disable_collapse_menu'] ) ? $request['settings']['fed_upl_disable_collapse_menu'] : null, 28 | ); 29 | 30 | $new_settings = apply_filters( 'fed_admin_settings_upl', $fed_admin_settings_upl, $request ); 31 | 32 | update_option( 'fed_admin_settings_upl', $new_settings ); 33 | 34 | wp_send_json_success( 35 | array( 36 | 'message' => __( 'User Profile Settings Updated Successfully ' ), 37 | ) 38 | ); 39 | } 40 | 41 | /** 42 | * Admin Setting User Profile Level Color request. 43 | */ 44 | function fed_admin_setting_upl_color_request() { 45 | $request = filter_input_array( INPUT_POST, FILTER_SANITIZE_STRING ); 46 | $fed_admin_settings_upl = get_option( 'fed_admin_setting_upl_color' ); 47 | $fed_admin_settings_upl['color'] = array( 48 | 'fed_upl_color_bg_color' => isset( $request['color']['fed_upl_color_bg_color'] ) ? sanitize_text_field( 49 | $request['color']['fed_upl_color_bg_color'] 50 | ) : '#0AAAAA', 51 | 52 | 'fed_upl_color_bg_font_color' => isset( $request['color']['fed_upl_color_bg_font_color'] ) ? sanitize_text_field( 53 | $request['color']['fed_upl_color_bg_font_color'] 54 | ) : '#ffffff', 55 | 56 | 'fed_upl_color_sbg_color' => isset( $request['color']['fed_upl_color_sbg_color'] ) ? sanitize_text_field( 57 | $request['color']['fed_upl_color_sbg_color'] 58 | ) : '#033333', 59 | 60 | 'fed_upl_color_sbg_font_color' => isset( $request['color']['fed_upl_color_sbg_font_color'] ) ? sanitize_text_field( 61 | $request['color']['fed_upl_color_sbg_font_color'] 62 | ) : '#ffffff', 63 | 64 | ); 65 | 66 | $new_value = apply_filters( 'fed_admin_settings_upl_color', $fed_admin_settings_upl, $request ); 67 | 68 | update_option( 'fed_admin_setting_upl_color', $new_value ); 69 | 70 | wp_send_json_success( 71 | array( 72 | 'message' => __( 'Color Settings Updated Successfully ' ), 73 | ) 74 | ); 75 | } 76 | -------------------------------------------------------------------------------- /includes/admin/validation/index.php: -------------------------------------------------------------------------------- 1 | prefix . 'users'; 41 | $now = date( 'Y-m-d H:i:s', time() ); 42 | $one_month = date( 'Y-m-d H:i:s', strtotime( '-1 month' ) ); 43 | 44 | $query = "SELECT DATE_FORMAT(user_registered,'%Y-%m-%d') as created, COUNT(*) as count FROM $table WHERE user_registered BETWEEN '{$one_month}' AND '{$now}' GROUP BY DATE_FORMAT(user_registered,'%Y-%m-%d')"; 45 | 46 | $users = $wpdb->get_results( $query, ARRAY_A ); 47 | 48 | $total_user_count = count_users(); 49 | 50 | $users_count = sprintf( 51 | /* Translators: %s Total Users */ 52 | __( 'Total Users Count - %s', 'frontend-dashboard' ), 53 | $total_user_count['total_users'] 54 | ); 55 | 56 | 57 | if ( $users && count( $users ) > 0 ) { 58 | $count = wp_list_pluck( $users, 'count' ); 59 | $created = wp_list_pluck( $users, 'created' ); 60 | ?> 61 |
62 | 63 |
64 | 87 | WP_REST_Server::READABLE, 8 | // // Here we register our callback. The callback is fired when this endpoint is matched by the WP_REST_Server class. 9 | // 'callback' => 'prefix_get_products', 10 | // ) ); 11 | // // Here we are registering our route for single products. The (?P[\d]+) is our path variable for the ID, which, in this example, can only be some form of positive number. 12 | // register_rest_route( 'my-shop/v1', '/products/(?P[\d]+)', array( 13 | // // By using this constant we ensure that when the WP_REST_Server changes our readable endpoints will work as intended. 14 | // 'methods' => WP_REST_Server::READABLE, 15 | // // Here we register our callback. The callback is fired when this endpoint is matched by the WP_REST_Server class. 16 | // 'callback' => 'prefix_get_product', 17 | // ) ); 18 | } 19 | 20 | //add_action( 'rest_api_init', 'fed_resp_api_init' ); -------------------------------------------------------------------------------- /includes/common/index.php: -------------------------------------------------------------------------------- 1 | default_admin_script() as $index => $scripts ) { 40 | foreach ( $scripts as $key => $script ) { 41 | if ( ! isset( $db_scripts['admin'][ $index ][ $key ] ) ) { 42 | fed_enqueue_scripts( $script, $index, $key ); 43 | } 44 | } 45 | } 46 | 47 | do_action( 'fed_enqueue_script_style_admin' ); 48 | 49 | wp_localize_script( 'fed_admin_script', 'frontend_dashboard', fed_js_translation() ); 50 | 51 | wp_enqueue_media(); 52 | } 53 | } 54 | } 55 | if ( ! function_exists( 'fed_script_front_end' ) ) { 56 | /** 57 | * Frontend Script. 58 | */ 59 | function fed_script_front_end() { 60 | $custom_condition = apply_filters( 'fed_show_frontend_script_on_custom_condition', false ); 61 | if ( fed_is_shortcode_in_content() || $custom_condition ) { 62 | $db_scripts = get_option( 'fed_general_scripts_styles', array() ); 63 | $default_scripts = new FED_Admin_General(); 64 | foreach ( $default_scripts->default_frontend_script() as $index => $scripts ) { 65 | foreach ( $scripts as $key => $script ) { 66 | if ( ! isset( $db_scripts['frontend'][ $index ][ $key ] ) ) { 67 | fed_enqueue_scripts( $script, $index, $key ); 68 | } 69 | } 70 | } 71 | 72 | do_action( 'fed_enqueue_script_style_frontend' ); 73 | 74 | if ( fed_is_dashboard() || fed_is_register() ) { 75 | wp_enqueue_script( 'password-strength-meter' ); 76 | } 77 | 78 | // Pass PHP value to JavaScript. 79 | $translation_array = apply_filters( 'fed_convert_php_js_var', fed_js_translation() ); 80 | 81 | wp_localize_script( 'fed_script', 'frontend_dashboard', $translation_array ); 82 | 83 | wp_enqueue_media(); 84 | } 85 | 86 | wp_enqueue_style( 'fed_global_admin_style' ); 87 | } 88 | } 89 | 90 | if ( ! function_exists( 'fed_enqueue_scripts' ) ) { 91 | /** 92 | * Enqueue Scripts. 93 | * 94 | * @param array $script Script. 95 | * @param string $index Index. 96 | * @param string $key Key. 97 | */ 98 | function fed_enqueue_scripts( $script, $index, $key ) { 99 | if ( 'scripts' === $index ) { 100 | if ( true === $script['wp_core'] ) { 101 | wp_enqueue_script( $key ); 102 | } else { 103 | wp_register_script( 104 | $key, $script['src'], $script['dependencies'], $script['version'], 105 | $script['in_footer'] 106 | ); 107 | wp_enqueue_script( $key ); 108 | } 109 | } 110 | if ( 'styles' === $index ) { 111 | if ( true === $script['wp_core'] ) { 112 | wp_enqueue_style( $key ); 113 | } else { 114 | wp_register_style( 115 | $key, $script['src'], $script['dependencies'], $script['version'], 116 | $script['media'] 117 | ); 118 | wp_enqueue_style( $key ); 119 | } 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /includes/config/config.php: -------------------------------------------------------------------------------- 1 | 'https://buffercode.com/api/fed/plugins', 19 | ) ); 20 | } 21 | 22 | /** 23 | * FED Get Dependent Plugins. 24 | * 25 | * @return mixed|void 26 | */ 27 | function fed_get_dependent_plugins() { 28 | return apply_filters( 'fed_dependent_plugins', array( 29 | 'frontend-dashboard-captcha', 30 | 'frontend-dashboard-custom-post', 31 | 'frontend-dashboard-pages', 32 | 'frontend-dashboard-templates', 33 | ) ); 34 | } 35 | -------------------------------------------------------------------------------- /includes/config/index.php: -------------------------------------------------------------------------------- 1 | 18 |
19 |
20 |

21 | 22 | 23 |

24 |
25 |
26 | 30 |
31 |
32 | 36 |
37 |
38 | 39 | 43 |
44 |
45 | 30 |
31 |
32 |

33 | 34 | 35 |

36 |
37 |
38 |
39 | isUserPaid() ) { 41 | if ( ! $payment_rbp->isUserUnderSubscription() ) { 42 | fed_display_user_not_paid( $payment_rbp ); 43 | } 44 | fed_display_user_paid( $payment_rbp->isUserPaid() ); 45 | } 46 | else { 47 | fed_display_user_not_paid( $payment_rbp ); 48 | } 49 | ?> 50 |
51 |
52 |
53 | 63 |
64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 79 | 80 | 81 | 82 | 83 | 86 | 87 | 93 | 94 | 97 | 98 |
DateTransaction IDInvoice NumberAmountPayment SourceDownload
88 | 90 | 91 | 92 |
99 |
100 | getSettings() !== null ) { 112 | 113 | ?> 114 |
115 |
119 | 120 | 123 | 124 |
125 |
126 | $user_data->get_error_messages() ) ); 27 | exit(); 28 | } 29 | 30 | // Redefining user_login ensures we return the right case in the email. 31 | $user_login = $user_data->user_login; 32 | $user_email = $user_data->user_email; 33 | $key = get_password_reset_key( $user_data ); 34 | 35 | if ( is_wp_error( $key ) ) { 36 | return $key; 37 | } 38 | $redirect_url = ( false == $redirect_url ) ? get_admin_url() : $redirect_url; 39 | 40 | $message = __( 41 | 'Someone has requested a password reset for the following account:', 'frontend-dashboard' 42 | ) . "\r\n\r\n"; 43 | $message .= network_home_url( '/' ) . "\r\n\r\n"; 44 | $message .= __( 'Username: ', 'frontend-dashboard' ) . $user_login . "\r\n\r\n"; 45 | $message .= __( 46 | 'If this was a mistake, just ignore this email and nothing will happen.', 47 | 'frontend-dashboard' 48 | ) . "\r\n\r\n"; 49 | $message .= __( 'To reset your password, visit the following address:', 'frontend-dashboard' ) . "\r\n\r\n"; 50 | $message .= '' . esc_url( $redirect_url ) . '' . "\r\n\r\n"; 57 | 58 | if ( is_multisite() ) { 59 | $blogname = $GLOBALS['current_site']->site_name; 60 | } else { 61 | $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); 62 | } 63 | 64 | $headers = array( 65 | 'Content-Type: text/html; charset=UTF-8', 66 | 'From: ' . $blogname . ' <' . get_bloginfo( 'admin_email' ) . '>', 67 | ); 68 | 69 | $title = __( 'Password Reset - ', 'frontend-dashboard' ) . $blogname; 70 | 71 | // phpcs:ignore 72 | if ( $message && ! wp_mail( $user_email, wp_specialchars_decode( $title ), $message, $headers ) ) { 73 | wp_send_json_error( 74 | array( 75 | 'user' => __( 76 | 'The email could not be sent. Possible reason: your host may have disabled the mail() function.', 77 | 'frontend-dashboard' 78 | ), 79 | 'message' => '', 80 | 'url' => '', 81 | ) 82 | ); 83 | exit(); 84 | } 85 | 86 | wp_send_json_success( 87 | array( 88 | 'user' => $user_data->ID, 89 | 'message' => __( 'Reset email sent to your email address', 'frontend-dashboard' ), 90 | 'url' => $redirect_url, 91 | ) 92 | ); 93 | } 94 | 95 | /** 96 | * Lost password url change filter. 97 | */ 98 | add_filter( 'lostpassword_url', 'fed_lostpassword_url' ); 99 | 100 | /** 101 | * Lost Password URL. 102 | * 103 | * @param string $lostpassword_url Lost Password URL. 104 | * 105 | * @return string 106 | */ 107 | function fed_lostpassword_url( $lostpassword_url ) { 108 | 109 | $fed_login_url = fed_get_login_url(); 110 | $lostpassword_url = ( false == $fed_login_url ) ? $lostpassword_url : ( $fed_login_url . '?page_type=reset_password&action=fed_forgot' ); 111 | 112 | return $lostpassword_url; 113 | } 114 | 115 | -------------------------------------------------------------------------------- /includes/frontend/request/login/index.php: -------------------------------------------------------------------------------- 1 | $post['user_login'], 22 | 'user_password' => $post['user_password'], 23 | 'remember' => isset( $post['remember'] ), 24 | ); 25 | 26 | $errors = fed_validate_login_form( $post ); 27 | 28 | if ( $errors instanceof WP_Error ) { 29 | wp_send_json_error( array( 'user' => $errors->get_error_messages() ) ); 30 | } 31 | 32 | $result = wp_signon( $credentials ); 33 | 34 | $redirect_url = apply_filters( 'fed_get_login_redirect_url', fed_get_login_redirect_url(), $result ); 35 | 36 | if ( $result instanceof WP_Error ) { 37 | wp_send_json_error( array( 'user' => $result->get_error_messages() ) ); 38 | } 39 | 40 | $redirect_url = ( false == $redirect_url ) ? home_url() : $redirect_url; 41 | 42 | wp_send_json_success( 43 | array( 44 | 'user' => $result, 45 | 'message' => __( 'Successfully Logged in', 'frontend-dashboard' ), 46 | 'url' => $redirect_url, 47 | 'reload' => $redirect_url, 48 | ) 49 | ); 50 | } 51 | -------------------------------------------------------------------------------- /includes/frontend/request/login/reset.php: -------------------------------------------------------------------------------- 1 | 'Invalid details', 21 | 'url' => fed_get_login_url(), 22 | ) 23 | ); 24 | } 25 | 26 | if ( empty( $request['user_password'] ) || empty( $request['confirmation_password'] ) ) { 27 | wp_send_json_error( array( 'user' => __( 'Please enter the Password', 'frontend-dashboard' ) ) ); 28 | } 29 | 30 | if ( $request['user_password'] !== $request['confirmation_password'] ) { 31 | wp_send_json_error( array( 'user' => __( 'Password not matched', 'frontend-dashboard' ) ) ); 32 | } 33 | $rp_key = wp_unslash( $request['key'] ); 34 | $rp_login = wp_unslash( $request['login'] ); 35 | 36 | $user = check_password_reset_key( $rp_key, $rp_login ); 37 | if ( $user instanceof WP_User ) { 38 | reset_password( $user, $request['user_password'] ); 39 | wp_send_json_success( 40 | array( 41 | 'message' => 'Successfully Password Reset', 42 | 'url' => fed_get_login_url(), 43 | ) 44 | ); 45 | } 46 | else { 47 | if ( $user instanceof WP_Error ) { 48 | wp_send_json_error( 49 | array( 'user' => __( 'Invalid Key, Please try resetting the password again', 'frontend-dashboard' ) ) 50 | ); 51 | } 52 | else { 53 | wp_send_json_error( 54 | array( 'user' => __( 'Something went wrong, Please try again later', 'frontend-dashboard' ) ) 55 | ); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /includes/frontend/request/login/validation.php: -------------------------------------------------------------------------------- 1 | add( 'password_not_match', __( 'Password not match', 'frontend-dashboard' ) ); 29 | } 30 | 31 | foreach ( $mandatory_fields as $key => $mandatory_field ) { 32 | if ( '' == $post[ $key ] ) { 33 | $fed_error->add( $key, $mandatory_field ); 34 | } 35 | } 36 | 37 | if ( $role && ! array_key_exists( $post['role'], $role ) ) { 38 | $fed_error->add( 'invalid_role', __( 'Invalid Role', 'frontend-dashboard' ) ); 39 | } 40 | 41 | if ( ! $role && isset( $post['role'] ) ) { 42 | $fed_error->add( 'invalid_role', __( 'You are trying to hack the user role', 'frontend-dashboard' ) ); 43 | } 44 | 45 | if ( isset( $post['user_login'] ) && fed_validate_username( $post['user_login'] ) ) { 46 | $fed_error->add( 47 | 'invalid_username', __( 'This Username is Illegal to use in this website', 'frontend-dashboard' ) 48 | ); 49 | } 50 | 51 | if ( $fed_error->get_error_codes() ) { 52 | return $fed_error; 53 | } 54 | 55 | return true; 56 | } 57 | 58 | /** 59 | * Login Form Validation. 60 | * 61 | * @param array $post post. 62 | * 63 | * @return bool|WP_Error 64 | */ 65 | function fed_validate_login_form( $post ) { 66 | $fed_error = new WP_Error(); 67 | $mandatory_fields = fed_login_mandatory_fields(); 68 | 69 | foreach ( $mandatory_fields as $key => $mandatory_field ) { 70 | if ( '' == $post[ $key ] ) { 71 | $fed_error->add( $key, $mandatory_field ); 72 | } 73 | } 74 | 75 | if ( $fed_error->get_error_codes() ) { 76 | return $fed_error; 77 | } 78 | 79 | return true; 80 | } 81 | 82 | /** 83 | * Lost Password Validation. 84 | * 85 | * @param array $post post. 86 | * 87 | * @return false|WP_Error|WP_User 88 | */ 89 | function fed_validate_forgot_password( $post ) { 90 | $errors = new WP_Error(); 91 | 92 | if ( empty( $post['user_login'] ) || '' == $post['user_login'] ) { 93 | $errors->add( 'empty_username', __( 'ERROR: Enter a username or email address.' ) ); 94 | } 95 | elseif ( strpos( $post['user_login'], '@' ) ) { 96 | $user_data = get_user_by( 'email', trim( wp_unslash( $post['user_login'] ) ) ); 97 | if ( empty( $user_data ) ) { 98 | $errors->add( 99 | 'invalid_email', __( 'ERROR: There is no user registered with that email address.' ) 100 | ); 101 | } 102 | } 103 | else { 104 | $login = trim( $post['user_login'] ); 105 | $user_data = get_user_by( 'login', $login ); 106 | } 107 | 108 | if ( $errors->get_error_code() ) { 109 | wp_send_json_error( array( 'user' => $errors->get_error_messages() ) ); 110 | } 111 | 112 | if ( ! $user_data ) { 113 | $errors->add( 'invalidcombo', __( 'ERROR: Invalid username or email.' ) ); 114 | 115 | wp_send_json_error( array( 'user' => $errors->get_error_messages() ) ); 116 | exit(); 117 | } 118 | 119 | return $user_data; 120 | } 121 | 122 | -------------------------------------------------------------------------------- /includes/frontend/request/user_profile/index.php: -------------------------------------------------------------------------------- 1 | get_error_messages(); 37 | } else { 38 | $user_data = fed_process_update_user_profile( $post_payload ); 39 | 40 | if ( wp_update_user( $user_data ) ) { 41 | $message = 'Successfully Updated'; 42 | } 43 | } 44 | fed_set_alert( 'fed_profile_save_message', $message ); 45 | } 46 | 47 | wp_safe_redirect( add_query_arg( array( 'fed_nonce' => wp_create_nonce( 'fed_nonce' ) ), 48 | $post_payload['_wp_http_referer'] ) ); 49 | 50 | } 51 | 52 | /** 53 | * Block The Action. 54 | */ 55 | function fed_block_the_action() { 56 | wp_die( 'Inappropriate Action' ); 57 | } 58 | 59 | /** 60 | * Process Update User Profile. 61 | * 62 | * @param array $post Post. 63 | * 64 | * @return array|\WP_Error 65 | */ 66 | function fed_process_update_user_profile( $post ) { 67 | $current_user = wp_get_current_user(); 68 | 69 | $user_obj = get_userdata( $current_user->ID ); 70 | 71 | $site_options = array_keys( fed_fetch_user_profile_not_extra_fields_key_value() ); 72 | 73 | if ( ! $user_obj ) { 74 | return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) ); 75 | } 76 | 77 | $new_value = array(); 78 | $new_value['ID'] = $current_user->ID; 79 | $new_value['user_login'] = $current_user->user_login; 80 | 81 | foreach ( $site_options as $site_option ) { 82 | if ( ( 'user_pass' == $site_option ) || ( 'confirmation_password' == $site_option ) ) { 83 | if ( isset( $post['user_pass'] ) && ! empty( $post['user_pass'] ) && $post['user_pass'] === $post['confirmation_password'] ) { 84 | $new_value[ $site_option ] = $post['user_pass']; 85 | } else { 86 | $new_value[ $site_option ] = ''; 87 | } 88 | } else { 89 | if ( array_key_exists( $site_option, $post ) ) { 90 | $new_value[ $site_option ] = is_array( $post[ $site_option ] ) ? serialize( 91 | $post[ $site_option ] 92 | ) : fed_sanitize_text_field( $post[ $site_option ] ); 93 | } else { 94 | $new_value[ $site_option ] = $user_obj->has_prop( $site_option ) ? $user_obj->get( $site_option ) : ''; 95 | } 96 | } 97 | } 98 | 99 | // Escape data pulled from DB. 100 | return add_magic_quotes( $new_value ); 101 | } 102 | 103 | -------------------------------------------------------------------------------- /includes/frontend/request/validation/index.php: -------------------------------------------------------------------------------- 1 | add( 'password_not_match', __( 'Password not match', 'frontend-dashboard' ) ); 31 | } 32 | 33 | foreach ( $mandatory_fields as $key => $mandatory_field ) { 34 | if ( '' == $post[ $key ] ) { 35 | $fed_error->add( $key, $mandatory_field ); 36 | } 37 | } 38 | 39 | if ( $fed_error->get_error_codes() ) { 40 | return $fed_error; 41 | } 42 | 43 | return true; 44 | } 45 | 46 | /** 47 | * Validate New Manual Order 48 | * 49 | * @param array $request Request. 50 | * 51 | * @return bool|WP_Error 52 | */ 53 | function fed_order_add_validation( $request ) { 54 | $fed_error = new WP_Error(); 55 | 56 | if ( empty( $request['user_id'] ) || ! isset( $request['user_id'] ) ) { 57 | wp_send_json_error( 58 | array( 59 | 'message' => __( 60 | 'You can able to add only the registered user, So please use the search functionality to find the user', 61 | 'frontend-dashboard' 62 | ), 63 | ) 64 | ); 65 | exit(); 66 | } 67 | 68 | $mandatory_fields = array( 69 | 'email' => 'Email', 70 | 'first_name' => 'First Name', 71 | 'last_name' => 'Last Name', 72 | 'amount' => 'Amount', 73 | 'user_id' => 'User ID', 74 | 'currency_type' => 'Currency Type', 75 | 'payment_source' => 'Payment Source', 76 | ); 77 | foreach ( $mandatory_fields as $key => $mandatory_field ) { 78 | if ( '' == $request[ $key ] ) { 79 | $fed_error->add( $key, $mandatory_field ); 80 | } 81 | } 82 | 83 | if ( $fed_error->get_error_codes() ) { 84 | return $fed_error; 85 | } 86 | 87 | return true; 88 | } 89 | -------------------------------------------------------------------------------- /includes/log/dashboard.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mavinothkumar/frontend-dashboard/1f0cb2e4a3c4ae21896ee9c7ebc93632845b8fe8/includes/log/dashboard.log -------------------------------------------------------------------------------- /includes/log/index.php: -------------------------------------------------------------------------------- 1 | get_template_part( 'dashboard' ); 20 | 21 | return ob_get_clean(); 22 | } 23 | 24 | add_shortcode( 'fed_dashboard', 'fed_fn_dashboard' ); 25 | } 26 | 27 | /** 28 | * Restricting logged in users not to use the dashboard page 29 | */ 30 | add_action( 'template_redirect', 'fed_dashboard_template_redirect' ); 31 | 32 | /** 33 | * Dashboard Template Redirect. 34 | */ 35 | function fed_dashboard_template_redirect() { 36 | 37 | if ( ! is_user_logged_in() ) { 38 | $location = fed_get_dashboard_url(); 39 | $login_page = fed_get_login_url(); 40 | if ( ( false != $location ) && ( get_permalink() == $location ) ) { 41 | $login_page = ( false == $login_page ) ? esc_url( wp_login_url() ) : $login_page; 42 | 43 | wp_safe_redirect( $login_page ); 44 | exit(); 45 | } 46 | } 47 | } 48 | 49 | add_filter( 'widget_text', 'do_shortcode' ); 50 | -------------------------------------------------------------------------------- /includes/shortcodes/dashboard/index.php: -------------------------------------------------------------------------------- 1 | get_template_part( 'login/registered', 'user' ); 21 | } else { 22 | $templates->get_template_part( 'login/forgot-password-only', 'user' ); 23 | } 24 | 25 | return ob_get_clean(); 26 | } 27 | 28 | add_shortcode( 'fed_forgot_password_only', 'fed_fn_forgot_password_only' ); 29 | } 30 | -------------------------------------------------------------------------------- /includes/shortcodes/login/index.php: -------------------------------------------------------------------------------- 1 | get_template_part( 'login/registered', 'user' ); 21 | } else { 22 | $templates->get_template_part( 'login/login-only', 'user' ); 23 | } 24 | 25 | return ob_get_clean(); 26 | } 27 | 28 | add_shortcode( 'fed_login_only', 'fed_fn_login_only' ); 29 | } -------------------------------------------------------------------------------- /includes/shortcodes/login/login-shortcode.php: -------------------------------------------------------------------------------- 1 | get_template_part( 'login/registered', 'user' ); 21 | } else { 22 | $templates->get_template_part( 'login/unregistered', 'user' ); 23 | } 24 | 25 | return ob_get_clean(); 26 | } 27 | 28 | add_shortcode( 'fed_login', 'fed_fn_login' ); 29 | } 30 | 31 | /** 32 | * Restricting logged in users not to use the login page 33 | */ 34 | add_action( 'template_redirect', 'fed_login_template_redirect' ); 35 | 36 | /** 37 | * Login Template Redirect. 38 | */ 39 | function fed_login_template_redirect() { 40 | if ( is_user_logged_in() ) { 41 | $login_page = fed_get_login_url(); 42 | // Check if WordPress VIP. 43 | // phpcs:ignore 44 | $url_to_post_id = function_exists( 'wpcom_vip_url_to_postid' ) ? wpcom_vip_url_to_postid( $login_page ) : url_to_postid( $login_page ); 45 | $location = fed_get_login_redirect_url(); 46 | 47 | if ( ( false != $login_page ) && is_page( $url_to_post_id ) ) { 48 | $location = ( false == $location ) ? home_url() : $location; 49 | 50 | wp_safe_redirect( $location ); 51 | exit(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /includes/shortcodes/login/register-only-shortcode.php: -------------------------------------------------------------------------------- 1 | get_template_part( 'login/registered', 'user' ); 21 | } else { 22 | $templates->get_template_part( 'login/register-only', 'user' ); 23 | } 24 | 25 | return ob_get_clean(); 26 | } 27 | 28 | add_shortcode( 'fed_register_only', 'fed_fn_register_only' ); 29 | } 30 | -------------------------------------------------------------------------------- /includes/shortcodes/payments/index.php: -------------------------------------------------------------------------------- 1 | get_template_part( 'payments/transactions' ); 19 | 20 | return ob_get_clean(); 21 | } 22 | 23 | add_shortcode( 'fed_transactions', 'fed_transactions' ); 24 | } 25 | -------------------------------------------------------------------------------- /includes/shortcodes/user-role.php: -------------------------------------------------------------------------------- 1 | 'subscriber', 21 | ), $role, 'fed_user' 22 | ); 23 | 24 | 25 | $templates = new FED_Template_Loader(); 26 | ob_start(); 27 | $templates->set_template_data( $role, 'fed_user_attr' ); 28 | $templates->get_template_part( 'user_role' ); 29 | 30 | 31 | return ob_get_clean(); 32 | } 33 | 34 | add_shortcode( 'fed_user', 'fed_user_fn' ); 35 | } 36 | -------------------------------------------------------------------------------- /includes/shortcodes/widget/index.php: -------------------------------------------------------------------------------- 1 | 0, 26 | 'current_category' => 0, 27 | 'depth' => 0, 28 | 'echo' => 0, 29 | 'exclude' => '', 30 | 'exclude_tree' => '', 31 | 'feed' => '', 32 | 'feed_image' => '', 33 | 'feed_type' => '', 34 | 'hide_empty' => 1, 35 | 'hide_title_if_empty' => false, 36 | 'hierarchical' => true, 37 | 'order' => 'ASC', 38 | 'orderby' => 'name', 39 | 'separator' => '
', 40 | 'show_count' => 0, 41 | 'show_option_all' => '', 42 | 'show_option_none' => __( 'No categories' ), 43 | 'style' => 'list', 44 | 'taxonomy' => null, 45 | 'title_li' => '', 46 | 'use_desc_for_title' => 1, 47 | ), $attributes 48 | ) 49 | ); 50 | 51 | 52 | if ( $taxonomy ) { 53 | $args = array( 54 | 'taxonomy' => $taxonomy, 55 | 'child_of' => $child_of, 56 | 'current_category' => $current_category, 57 | 'depth' => $depth, 58 | 'echo' => $echo, 59 | 'exclude' => $exclude, 60 | 'exclude_tree' => $exclude_tree, 61 | 'feed' => $feed, 62 | 'feed_image' => $feed_image, 63 | 'feed_type' => $feed_type, 64 | 'hide_empty' => $hide_empty, 65 | 'hide_title_if_empty' => $hide_title_if_empty, 66 | 'hierarchical' => $hierarchical, 67 | 'order' => $order, 68 | 'orderby' => $orderby, 69 | 'separator' => $separator, 70 | 'show_count' => $show_count, 71 | 'show_option_all' => $show_option_all, 72 | 'show_option_none' => $show_option_none, 73 | 'style' => $style, 74 | 'title_li' => $title_li, 75 | 'use_desc_for_title' => $use_desc_for_title, 76 | ); 77 | 78 | $categories = wp_list_categories( $args ); 79 | 80 | if ( empty( $categories ) ) { 81 | return __( 'Invalid Taxonomy, Please Check The Taxonomy Name', 'frontend-dashboard' ); 82 | } 83 | 84 | $html .= ''; 87 | 88 | return $html; 89 | } 90 | 91 | return __( 'Please Add Taxonomy Name like [fed_list_taxonomy taxonomy=TAXONOMY_NAME]', 'frontend-dashboard' ); 92 | } -------------------------------------------------------------------------------- /includes/shortcodes/widget/taxonomy.php: -------------------------------------------------------------------------------- 1 | 0, 28 | 'current_category' => 0, 29 | 'depth' => 0, 30 | 'echo' => 0, 31 | 'exclude' => '', 32 | 'exclude_tree' => '', 33 | 'feed' => '', 34 | 'feed_image' => '', 35 | 'feed_type' => '', 36 | 'hide_empty' => 1, 37 | 'hide_title_if_empty' => false, 38 | 'hierarchical' => true, 39 | 'order' => 'ASC', 40 | 'orderby' => 'name', 41 | 'separator' => '
', 42 | 'show_count' => 0, 43 | 'show_option_all' => '', 44 | 'show_option_none' => __( 'No categories' ), 45 | 'style' => 'list', 46 | 'taxonomy' => null, 47 | 'title_li' => '', 48 | 'use_desc_for_title' => 1, 49 | ), $attributes 50 | ) 51 | ); 52 | 53 | 54 | if ( $taxonomy ) { 55 | $args = array( 56 | 'taxonomy' => $taxonomy, 57 | 'child_of' => $child_of, 58 | 'current_category' => $current_category, 59 | 'depth' => $depth, 60 | 'echo' => $echo, 61 | 'exclude' => $exclude, 62 | 'exclude_tree' => $exclude_tree, 63 | 'feed' => $feed, 64 | 'feed_image' => $feed_image, 65 | 'feed_type' => $feed_type, 66 | 'hide_empty' => $hide_empty, 67 | 'hide_title_if_empty' => $hide_title_if_empty, 68 | 'hierarchical' => $hierarchical, 69 | 'order' => $order, 70 | 'orderby' => $orderby, 71 | 'separator' => $separator, 72 | 'show_count' => $show_count, 73 | 'show_option_all' => $show_option_all, 74 | 'show_option_none' => $show_option_none, 75 | 'style' => $style, 76 | 'title_li' => $title_li, 77 | 'use_desc_for_title' => $use_desc_for_title, 78 | ); 79 | 80 | $categories = wp_list_categories( $args ); 81 | 82 | if ( empty( $categories ) ) { 83 | return __( 'Invalid Taxonomy, Please Check The Taxonomy Name', 'frontend-dashboard' ); 84 | } 85 | 86 | $html .= ''; 89 | 90 | return $html; 91 | } 92 | 93 | return __( 'Please Add Taxonomy Name like [fed_list_taxonomy taxonomy=TAXONOMY_NAME]', 'frontend-dashboard' ); 94 | } -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | request = $request; 30 | } 31 | 32 | /** 33 | * Dashboard Content. 34 | * 35 | * @param array $menu Menu. 36 | */ 37 | public function getDashboardContent( $menu ) { 38 | if ( 'user' === $menu['menu_request']['menu_type'] ) { 39 | fed_display_dashboard_profile( $menu['menu_request'] ); 40 | } 41 | if ( 'logout' === $menu['menu_request']['menu_type'] ) { 42 | fed_logout_process( $menu['menu_request'] ); 43 | } 44 | 45 | do_action( 'fed_frontend_dashboard_menu_container', $this->request, $menu ); 46 | } 47 | 48 | /** 49 | * Set Dashboard Menu Query. 50 | * 51 | * @return array|bool|\WP_Error 52 | */ 53 | public function setDashboardMenuQuery() { 54 | $menu = fed_get_dashboard_menu_items_sort_data(); 55 | $first_element_key = array_keys( $menu ); 56 | $first_element = $first_element_key[0]; 57 | 58 | if ( count( array_diff( $this->getDefaultMenuQuery(), array_keys( $this->request ) ) ) !== 0 ) { 59 | $menu_items = array( 60 | 'menu_request' => array( 61 | 'menu_type' => $menu[ $first_element ]['menu_type'], 62 | 'menu_slug' => $menu[ $first_element ]['menu_slug'], 63 | 'menu_id' => $menu[ $first_element ]['id'], 64 | 'fed_nonce' => wp_create_nonce( 'fed_nonce' ), 65 | ), 66 | ); 67 | } else { 68 | $menu_items = array( 69 | 'menu_request' => array( 70 | 'menu_type' => $this->request['menu_type'], 71 | 'menu_slug' => $this->request['menu_slug'], 72 | 'menu_id' => $this->request['menu_id'], 73 | 'fed_nonce' => wp_create_nonce( 'fed_nonce' ), 74 | ), 75 | ); 76 | } 77 | 78 | $menu_items['menu_items'] = $menu; 79 | 80 | /** 81 | * Check for Nonce 82 | */ 83 | if ( $this->validateNonce( $menu_items['menu_request'] ) instanceof WP_Error ) { 84 | return $this->validateNonce( $menu_items['menu_request'] ); 85 | } 86 | 87 | /** 88 | * Check the Menu type is valid 89 | */ 90 | if ( ! in_array( $menu_items['menu_request']['menu_type'], $this->getDefaultMenuType(), true ) ) { 91 | return new WP_Error( 'invalid_menu_type', 'Invalid Menu Type in URL 1' ); 92 | } 93 | /** 94 | * Check is the menu is allowed for this user 95 | */ 96 | 97 | if ( 98 | isset( $this->request['menu_slug'] ) && ! in_array( 99 | $this->request['menu_slug'], 100 | fed_get_keys_from_menu( $menu ) 101 | ) 102 | ) { 103 | return new WP_Error( 'invalid_menu_type', 'Invalid Menu Type in URL 2' ); 104 | } 105 | 106 | set_query_var( 'fed_menu_items', $menu_items ); 107 | 108 | wp_cache_set( 'fed_dashboard_menu_' . get_current_user_id(), $menu_items, 'frontend-dashboard', 60 ); 109 | 110 | return $menu_items; 111 | } 112 | 113 | /** 114 | * Get Default Menu Query. 115 | * 116 | * @return mixed|void 117 | */ 118 | public function getDefaultMenuQuery() { 119 | return apply_filters( 'fed_get_default_menu_query', array( 'menu_type', 'menu_slug', 'fed_nonce' ) ); 120 | } 121 | 122 | /** 123 | * Get Default Menu Type. 124 | * 125 | * @return mixed|void 126 | */ 127 | public function getDefaultMenuType() { 128 | return fed_get_default_menu_type(); 129 | } 130 | 131 | /** 132 | * Validate Nonce. 133 | * 134 | * @param array $request Request. 135 | * 136 | * @return bool|\WP_Error 137 | */ 138 | private function validateNonce( $request ) { 139 | if ( ! isset( $request['fed_nonce'] ) ) { 140 | return new WP_Error( 'invalid_request', 'Invalid Request' ); 141 | } 142 | if ( ! wp_verify_nonce( $request['fed_nonce'], 'fed_nonce' ) ) { 143 | return new WP_Error( 'invalid_request', 'Invalid Request' ); 144 | } 145 | 146 | return true; 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /route/index.php: -------------------------------------------------------------------------------- 1 | setDashboardMenuQuery(); 10 | do_action( 'fed_before_dashboard_container' ); 11 | $is_mobile = fed_get_menu_mobile_attributes(); 12 | ?> 13 |
14 | 15 | 16 | 17 | 21 |
22 |
23 |
24 | 37 |
39 | 45 |
46 |
47 |
48 |
49 | getDashboardContent( $menu ); 53 | do_action( 'fed_dashboard_content_bottom' ); 54 | do_action( 'fed_dashboard_content_bottom_' . fed_get_data( 'menu_request.menu_slug', $menu ) ); 55 | ?> 56 |
57 |
58 | 64 |
65 | 66 |
67 | 69 | 70 |
71 | 14 | 94 | 18 | 90 | 13 | 80 | 14 |
15 | 16 | 17 | 18 |
19 | 20 | -------------------------------------------------------------------------------- /templates/login/unregistered-user.php: -------------------------------------------------------------------------------- 1 | 24 | 107 | 17 | 18 |
19 |
20 | 25 |
26 |
27 | 28 | -------------------------------------------------------------------------------- /vendor/template-loaders/page-template/layouts/fed-login.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 18 |
19 |
20 | 9 |
10 |
11 | 16 |
17 |
18 | -------------------------------------------------------------------------------- /vendor/template-loaders/page-template/layouts/index.php: -------------------------------------------------------------------------------- 1 |