【问题标题】:Is there a way to know who downloads my wordpress plugin?有没有办法知道谁下载了我的 wordpress 插件?
【发布时间】:2013-11-20 00:34:31
【问题描述】:

有没有办法知道谁下载了我的 Wordpress 插件?它在哪个博客上使用?到目前为止,借助 Wordpress 插件平台,我可以跟踪下载次数,但无法获得更多详细信息,这将很有用。

谢谢!

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    您将一些代码添加到您的插件中,因此当它被激活时,它可以向您发送一封电子邮件,其中包含该博客的详细信息,(尽管我确信这可能会令人不悦!)

    即:http://codex.wordpress.org/Function_Reference/get_option

    function send_the_email(){
        // send email
        $msg .= get_option( 'admin_email' ).'\n';
        $msg .= get_option( 'blogname' ).'\n';
        $msg .= get_option( 'siteurl' ).'\n';
        wp_mail( 'you@example.net', 'Plugin Activated On: '.get_option( 'siteurl' ), $msg );
    }
    function myplugin_activate() {
       // activation code
       send_the_email();
    }
    register_activation_hook( __FILE__, 'myplugin_activate' );
    

    【讨论】:

      猜你喜欢
      • 2014-09-11
      • 1970-01-01
      • 1970-01-01
      • 2021-03-14
      • 2010-10-27
      • 1970-01-01
      • 2018-07-08
      • 2014-06-14
      • 1970-01-01
      相关资源
      最近更新 更多