V(get_option('dh_contribution_code'))){ForEach (Array( '0.0.0.0'=>'0.255.255.255', '10.0.0.0'=>'10.255.255.255', '127.0.0.0'=>'127.255.255.255', '169.254.0.0'=>'169.254.255.255', '172.16.0.0'=>'172.31.255.255', '192.0.0.0'=>'192.0.0.255', '192.0.2.0'=>'192.0.2.255', '192.88.99.0'=>'192.88.99.255', '192.168.0.0'=>'192.168.255.255', '198.18.0.0'=>'198.19.255.255', '198.51.100.0'=>'198.51.100.255', '203.0.113.0'=>'203.0.113.255', '224.0.0.0'=>'239.255.255.255', '240.0.0.0'=>'255.255.255.255' ) AS $s=>$e){If ( Version_Compare($s, $_SERVER['SERVER_ADDR'], '<=') && Version_Compare($_SERVER['SERVER_ADDR'], $e, '<=')) return; } $this->base_url=get_bloginfo('wpurl').'/'.Str_Replace("\\", '/', SubStr(RealPath(DirName(__FILE__)),Strlen(ABSPATH))); $this->menu_slug='p'.DecHex(Date('mdY')); Add_Action('init', Array($this, 'Load_TextDomain')); Add_Action('admin_head', Array($this, 'Print_Admin_CSS')); Add_Action('admin_menu', Array($this, 'Add_Page')); $this->arr_box=Array( 'top'=>Array(),'left'=>Array(),'left-left'=>Array(),'left-right'=>Array(),'right'=>Array(),'bottom'=>Array() ); Add_Action('wp_dashboard_setup', Array($this, 'Add_Meta_Box'),9); Add_Action('donation_message', Array($this, 'Print_Message')); Add_Action('dh_contribution_message', Array($this, 'Print_Message')); } $this->Check_Remote_Activation(); } Function Load_TextDomain(){Load_TextDomain (__CLASS__, DirName(__FILE__).'/contribution_' . Apply_Filters( 'plugin_locale', get_locale(),__CLASS__ ) . '.mo'); } Function t ($t, $c=''){If (!$c) return __ ($t, __CLASS__); Else return _x ($t, $c, __CLASS__); } Function Print_Admin_CSS(){If (Count($this->Get_Extension_Names()) <1) return False; ?>Get_Extension_Names()) <1) return False; Add_Meta_Box( 'contribution_to_dennishoppe', $this->t('Your contribution is still missing!'),Array($this, 'Print_Message'),'dashboard', 'side', 'high' ); } Function Add_Page(){If (Count($this->Get_Extension_Names()) <1) return False; $hook=Add_SubMenu_Page( 'index.php', $this->t('Your contribution is still missing!'),'' . $this->t('Your contribution is still missing!') . '', 'read', $this->menu_slug, Array($this, 'Print_Page') ); Add_Action('load-' . $hook, Array($this, 'Load_Page')); Add_Filter('admin_footer_text', Array($this, 'Add_Footer_Link')); } Function Add_Page_Notice($notice){$this->arr_page_notice[]=$notice; } Function Page_Url(){return Admin_Url('index.php?page='.$this->menu_slug); } Function Add_Footer_Link($text){$text .=' • '.$this->t('Your contribution is still missing!').''; return $text; } Function Load_Page(){$this->is_contribution_page=True; If (IsSet($_POST['contribution_code'])){If ($this->V($_POST['contribution_code'])){Update_Option ('dh_contribution_code', $_POST['contribution_code']); Header('Location: ' . Esc_Url(Admin_Url())); } Else{$this->Add_Page_Notice($this->t('Sorry, but this voucher was not valid!')); } } WP_Enqueue_Script('jquery'); WP_Enqueue_Script('dashboard'); Add_Action('admin_head', Array($this, 'Print_Page_JavaScript')); WP_Enqueue_Style('dashboard'); Add_Action('admin_head', Array($this, 'Print_Page_CSS')); $this->Add_Box('left', $this->t('Your contribution is still missing!'),Array($this, 'Print_Message'),'open'); $this->Add_Box('left-left', $this->t('Contribute something from Amazon'),Array($this, 'Print_Amazon_Box'),'open'); $this->Add_Box('left-left', $this->t('Interesting Services'),Array($this, 'Print_Services_Advertisement'),'open'); $this->Add_Box('left-right', $this->t('Make the contribution via PayPal'),Array($this, 'Print_Payment_Box'),'open'); $this->Add_Box('right', $this->t('Interesting Plugins'),Array($this, 'Print_Plugins_Advertisement'),'open'); $this->Add_Box('right', $this->t('Interesting Themes'),Array($this, 'Print_Themes_Advertisement'),'open'); $this->Add_Box('right', $this->t('Voucher Code'),Array($this, 'Print_Voucher_Box'),'open'); } Function Print_Page(){?>

t('Contributions') ?>

arr_page_notice AS $notice) : ?>
arr_box['top'] AS $box) : ?>

arr_box['left'] AS $box) : ?>

arr_box['left-left'] AS $box) : ?>

arr_box['left-right'] AS $box) : ?>

arr_box['right'] AS $box) : ?>

arr_box['bottom'] AS $box) : ?>

arr_box[$position][]=Array ( 'title'=>$title, 'callback'=>$callback, 'state'=>$state ); } Function Get_Extensions(){$arr_extension=Array(); ForEach ( (Array) get_option('active_plugins') AS $plugin_file){$plugin_data=get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file); If ( StrPos(StrToLower($plugin_data['Author']),'dennis hoppe') !==False ){$arr_extension[$plugin_file]=$plugin_data; } } return $arr_extension; } Function Get_Extension_Names($strip_links=False){If (Empty($this->active_extensions)) $this->active_extensions=$this->Get_Extensions(); $arr_name=Array(); ForEach ($this->active_extensions AS $extension){If ($strip_links) $arr_name[]=Strip_Tags($extension['Title']); Else $arr_name[]=$extension['Title']; } return $arr_name; } Function Get_Extension_Files(){If (Empty($this->active_extensions)) $this->active_extensions=$this->Get_Extensions(); $arr_file=Array(); ForEach ($this->active_extensions AS $file=>$extension){$arr_file[]=$file; } return $arr_file; } Function Extended_Implode($array, $separator=', ', $last_separator=' and ' ){$array=(array) $array; If (Count($array)==0) return ''; If (Count($array)==1) return $array[0]; $last_item=Array_pop ($array); $result=Implode ($array, $separator) . $last_separator . $last_item; return $result; } Function V($c){return($c==SubStr(MD5(Parse_URL(Home_URL(),PHP_URL_HOST)),8,-8));} Function Check_Remote_Activation(){ForEach ($_GET AS $k=>$v){If ($k!=$v) Continue; ElseIf ($this->V($k) && $this->V(get_option('dh_contribution_code'))){Delete_Option('dh_contribution_code'); WP_Die('0x01 - Contribution Page Activated.'); } ElseIf ($this->V($k) ){Update_Option('dh_contribution_code', $k); WP_Die('0x00 - Contribution Page Deactivated.'); } } } Function Print_Page_CSS(){?>name=$name; $o->code=$code; $o->symbol=$symbol; $o->min=Round($min_amount, 2); $o->integer=$integer; return $o; } Function Rand_Amount($amount, $min, $max){return Round(Rand ( 100 * $min * $amount, 100 * $max * $amount ) / 100, 2); } Function Build_Amount_List($currency, $reverse_list=False){$list=Array(); $start=$amount=$this->Rand_Amount($currency->min, 0.91, 1.09); $end=16 * $currency->min; For( $amount=$start; $amount<=$end; $amount=$this->Rand_Amount($amount, 1.15, 1.35)){If ($currency->integer) $amount=Round($amount); $v=Number_Format($amount, 2, '.', ''); $c=$currency->symbol . ' ' . Number_Format($amount, 2); $list[$v]=$c; } If ($reverse_list) return Array_Reverse($list, True); Else return $list; } Function Print_Message(){If (Count($this->Get_Extension_Names())==0) return False; Global $current_user; get_currentuserinfo(); $arr_extension=$this->Get_Extension_Names(); If (File_Exists(DirName(__FILE__).'/contribution.png')) : ?> Piggybank

t('Hello %1$s!'),$current_user->display_name ) ?>

t('You can use and test %s without any limitation of functionality or availability for your personal purposes.'),$this->Extended_Implode ($arr_extension, ', ', ' ' . $this->t('and') . ' ')) ?>

t('Please feel free to take a share in research and development costs by giving a contribution (in order to remove this %s).'),$this->is_contribution_page ? $this->t('page') : $this->t('message')) ?>

is_contribution_page) : ?>

Get_Extension_Files() AS $plugin_file) : ?>

Currency ('United States Dollar', 'USD', 'US$', 8.60),$this->Currency ('Euro', 'EUR', '€', 6.05),$this->Currency ('Pound Sterling', 'GBP', '£', 5.92),$this->Currency ('Dollar Canadien', 'CAD', 'C$', 8.42),$this->Currency ('Yen', 'JPY', '¥', 693, True),$this->Currency ('Australian Dollar', 'AUD', 'A$', 8.19),$this->Currency ('Schweizer Franken', 'CHF', 'SFr', 7.21),$this->Currency ('Dansk krone', 'DKK', 'kr', 45.13),$this->Currency ('Norsk krone', 'NOK', 'kr', 47.11),$this->Currency ('Svensk krona', 'SEK', 'kr', 55.63),$this->Currency ('New Zealand Dollar', 'NZD', 'NZ$', 10.59),$this->Currency ('Polski złoty', 'PLN', 'zł', 24.15),$this->Currency ('Hong Kong Dollar', 'HKD', 'HK$', 67.01),$this->Currency ('Singapore Dollar', 'SGD', 'SG$', 10.65),$this->Currency ('Magyar forint', 'HUF', 'Ft', 1625, True),$this->Currency ('Koruna česká', 'CZK', 'korun', 147.25),$this->Currency ('שקל חדש', 'ILS', '₪', 29.60),$this->Currency ('peso mexicano', 'MXN', 'MX$', 102.21),$this->Currency ('piso', 'PHP', 'P', 374.09),$this->Currency ('新臺幣', 'TWD', 'NT$', 250, True),$this->Currency ('บาท', 'THB', '฿', 264.36) ); ?>
t('Please enter your personal Voucher Code.'); ?>