public function __construct() { self::$errors = new WP_Error(); self::$success = new WP_Error(); if (defined("WP_RW__DEBUG") || true === $this->_getOption("WP_RW__LOGGER")) { // Start logger. RWLogger::PowerOn(); } $rw_show_on_mobile = $this->_getOption(WP_RW__SHOW_ON_MOBILE); if (RWLogger::IsOn()) { RWLogger::Log("WP_RW__SHOW_ON_MOBILE", $rw_show_on_mobile); } if ("false" === $rw_show_on_mobile) { require_once WP_RW__PLUGIN_DIR . "/vendors/class.mobile.detect.php"; $detect = new Mobile_Detect(); $is_mobile = $detect->isMobile(); if (RWLogger::IsOn()) { RWLogger::Log("WP_RW__IS_MOBILE_CLIENT", $is_mobile ? "true" : "false"); } if ($is_mobile) { // Don't show any ratings. self::$WP_RW__HIDE_RATINGS = true; return; } } // Load user key. $this->load_user_key(); RWLogger::Log("WP_RW__VERSION", WP_RW__VERSION); if (RWLogger::IsOn()) { RWLogger::Log("WP_RW__USER_KEY", WP_RW__USER_KEY); RWLogger::Log("WP_RW__USER_SECRET", WP_RW__USER_SECRET); RWLogger::Log("WP_RW__DOMAIN", WP_RW__DOMAIN); RWLogger::Log("WP_RW__SERVER_ADDR", WP_RW__SERVER_ADDR); RWLogger::Log("WP_RW__CLIENT_ADDR", WP_RW__CLIENT_ADDR); RWLogger::Log("WP_RW__PLUGIN_DIR", WP_RW__PLUGIN_DIR); RWLogger::Log("WP_RW__PLUGIN_URL", WP_RW__PLUGIN_URL); //RWLogger::Log("WP_RW__BP_INSTALLED", (WP_RW__BP_INSTALLED ? "true" : "false")); //RWLogger::Log("WP_RW__BBP_INSTALLED", (WP_RW__BBP_INSTALLED ? "true" : "false")); } if (false !== WP_RW__USER_KEY) { // Posts/Pages/Comments add_action("loop_start", array(&$this, "rw_before_loop_start")); if (WP_RW__BP_INSTALLED) { // BuddyPress earlier than v.1.5 $this->rw_init_bp(); } else { // BuddyPress v.1.5 and latter. add_action("bp_include", array(&$this, "rw_init_bp")); } // wp_footer call validation. // add_action('init', array(&$this, 'test_footer_init')); // Rating-Widget main javascript load. add_action('wp_footer', array(&$this, "rw_attach_rating_js")); } add_action('admin_head', array(&$this, "rw_admin_menu_icon_css")); add_action('admin_menu', array(&$this, 'admin_menu')); /** * IMPORTANT: * All scripts/styles must be enqueued from those actions, * otherwise it will mass-up the layout of the admin's dashboard * on RTL WP versions. */ add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts')); add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts')); require_once WP_RW__PLUGIN_DIR . "/languages/dir.php"; $this->languages = $rw_languages; $this->languages_short = array_keys($this->languages); }