PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 2.5.3
ShareThis Dashboard for Google Analytics v2.5.3
3.3.2 trunk 1.0.7 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.5 2.3.5 2.3.6 2.3.7 2.3.8 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.0.0 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3.0 3.3.1
googleanalytics / class / core / Ga_Controller_Core.php
googleanalytics / class / core Last commit date
Ga_Controller_Core.php 6 years ago Ga_View_Core.php 5 years ago
Ga_Controller_Core.php
41 lines
1 <?php
2
3 /**
4 * Created by PhpStorm.
5 * User: mdn
6 * Date: 2017-02-01
7 * Time: 09:46
8 */
9 class Ga_Controller_Core {
10
11 const GA_NONCE_FIELD_NAME = '_gawpnonce';
12 const ACTION_PARAM_NAME = 'ga_action';
13
14 /**
15 * Runs particular action.
16 */
17 public function handle_actions() {
18 $action = !empty( $_REQUEST[ self::ACTION_PARAM_NAME ] ) ? $_REQUEST[ self::ACTION_PARAM_NAME ] : null;
19
20 if ( $action ) {
21 $class = get_class( $this );
22 if ( is_callable( array(
23 $class,
24 $action
25 ) ) ) {
26 call_user_func( $class . '::' . $action );
27 }
28 }
29 }
30
31 /**
32 * Verifies nonce for given acction.
33 *
34 * @param $action
35 * @return bool
36 */
37 public static function verify_nonce( $action ) {
38 return isset( $_POST[ self::GA_NONCE_FIELD_NAME ] ) && wp_verify_nonce( $_POST[ self::GA_NONCE_FIELD_NAME ], $action );
39 }
40 }
41